Content Delivery Framework having Storage Services

ABSTRACT

A framework supporting content delivery and comprising a plurality of devices, each device configured to run at least one content delivery (CD) service of a plurality of CD services, wherein the plurality of CD services comprise: collector services, reducer services, storage services, and control services; and wherein at least some of the plurality of devices run storage services, and wherein the storage services running on the at least some of the plurality of devices comprise at least one storage services network. At least one storage service is configured to provide persistent storage that is locally and/or globally addressable.

RELATED APPLICATIONS

This application is a continuation-in-part (CIP) of co-pending andco-owned U.S. patent application Ser. No. 13/714,412, filed Dec. 14,2012, titled “Content Delivery Framework” [0447-US-U1], the entirecontents of which are hereby fully incorporated herein by reference forall purposes. U.S. patent application Ser. No. 13/714,412 claimspriority from Provisional Application No. 61/737,072 filed Dec. 13,2012, the entire contents of each of which are hereby fully incorporatedherein by reference for all purposes.

INCORPORATION BY REFERENCE

The following U.S. patents and published U.S. patent applications arehereby fully incorporated herein by reference for all purposes:

-   -   1. U.S. Pat. No. 7,822,871 titled “Configurable Adaptive Global        Traffic Control And Management,” filed Sep. 30, 2002, issued        Oct. 26, 2010.    -   2. U.S. Pat. No. 7,860,964 titled “Policy-Based Content Delivery        Network Selection,” filed Oct. 26, 2007, issued Dec. 28, 2010.    -   3. U.S. Pat. No. 6,185,598 titled “Optimized Network Resource        Location,” filed Feb. 10, 1998, issued Feb. 6, 2001.    -   4. U.S. Pat. No. 6,654,807 titled “Internet Content Delivery        Network,” filed Dec. 6, 2001, issued Nov. 25, 2003.    -   5. U.S. Pat. No. 7,949,779 titled “Controlling Subscriber        Information Rates In A Content Delivery Network,” filed Oct. 31,        2007, issued May 24, 2011.    -   6. U.S. Pat. No. 7,945,693 titled “Controlling Subscriber        Information Rates In A Content Delivery Network,” filed Oct. 31,        2007, issued May 17, 2011.    -   7. U.S. Pat. No. 7,054,935 titled “Internet Content Delivery        Network,” filed Mar. 13, 2002, issued May 30, 2006.    -   8. U.S. Published Patent Application No. 2009-0254661 titled        “Handling Long-Tail Content In A Content Delivery Network        (CDN),” filed Mar. 21, 2009.    -   9. U.S. Published Patent Application No. 2010-0332595 titled        “Handling Long-Tail Content In A Content Delivery Network        (CDN),” filed Sep. 13, 2010.    -   10. U.S. Pat. No. 8,015,298 titled “Load-Balancing Cluster,”        filed Feb. 23, 2009, issued Sep. 6, 2011.    -   11. U.S. Published Patent Application No. 2010-0332664 titled        “Load-Balancing Cluster,” filed Sep. 13, 2010, issued Jul. 16,        2013 as U.S. Pat. No. 8,489,750.    -   12. U.S. Published Patent Application No. 2012-0198043, titled        “Customized Domain Names In A Content Delivery Network (CDN),”        filed Jan. 11, 2012, published Aug. 2, 2012.    -   13. U.S. Pat. No. 8,060,613 titled “Resource Invalidation In A        Content Delivery Network,” filed Oct. 31, 2007, issued Nov. 15,        2011.    -   14. application Ser. No. 13/714,410, titled “Content Delivery        Network,” filed Dec. 12, 2012, U.S. Published Patent Application        No. 2013-0159472, which claimed priority to U.S. provisional        applications Nos. 61/570,448 and 61/570,486, and    -   15. application Ser. No. 13/714,411, titled “Content Delivery        Network,” filed Dec. 12, 2012, U.S. Published Patent Application        No. 2013-0159473, which claimed priority to U.S. provisional        applications Nos. 61/570,448 and 61/570,486.

BACKGROUND OF THE INVENTION Copyright Statement

This patent document contains material subject to copyright protection.The copyright owner has no objection to the reproduction of this patentdocument or any related materials in the files of the United StatesPatent and Trademark Office, but otherwise reserves all copyrightswhatsoever.

FIELD OF THE INVENTION

This invention relates to content delivery and content deliverynetworks. More specifically, to content delivery networks and systems,frameworks, devices and methods supporting content delivery and contentdelivery networks.

BRIEF DESCRIPTION OF THE DRAWINGS

Other objects, features, and characteristics of the present invention aswell as the methods of operation and functions of the related elementsof structure, and the combination of parts and economies of manufacture,will become more apparent upon consideration of the followingdescription and the appended claims with reference to the accompanyingdrawings, all of which form a part of this specification.

FIG. 1-A shows an exemplary categorization of services types in acontent delivery network (CDN) in accordance with an embodiment;

FIG. 1-B shows a generic service endpoint in an exemplary CDN inaccordance with an embodiment;

FIG. 1-C shows trivial service types in accordance with an embodiment;

FIG. 1-D shows an exemplary taxonomy of service types in a CDN inaccordance with an embodiment;

FIGS. 1-E to 1-F show interactions between component services of anexemplary CDN in accordance with an embodiment;

FIG. 1-G shows an exemplary taxonomy of service types in a CDN inaccordance with an embodiment;

FIG. 1-H depicts aspects of information flow between services in a CDNin accordance with an embodiment;

FIG. 1-I depicts aspects of an exemplary CDN infrastructure inaccordance with an embodiment;

FIG. 1-J depicts a logical overview of an exemplary CDN in accordancewith an embodiment;

FIG. 1-K shows feedback between logical service endpoints in a CDN inaccordance with an embodiment;

FIG. 1-L depicts interactions between component services of an exemplaryCDN in accordance with an embodiment;

FIGS. 1-M, 1-N, 1-O, and 1-P depict aspects of logical service endpointsand interactions between component services of an exemplary CDN inaccordance with an embodiment;

FIG. 2-A depicts aspects of a machine in an exemplary CDN in accordancewith an embodiment;

FIG. 2-B depicts aspects of configuration of a machine in a CDN inaccordance with an embodiment;

FIGS. 2-C to 2-D depict aspects of an exemplary autonomic service in anexemplary CDN in accordance with an embodiment;

FIGS. 3-A to 3-B depict aspects of clusters of service endpoints in anexemplary CDN in accordance with an embodiment;

FIG. 3-C depicts various aspects of exemplary bindings in an exemplaryCDN in accordance with an embodiment;

FIG. 3-D depicts various aspects of binding and rendezvous in anexemplary CDN in accordance with an embodiment;

FIG. 3-E depicts aspects of request processing by a service in anexemplary CDN in accordance with an embodiment;

FIG. 3-F depicts aspects of a general purpose and configurable model ofrequest processing in accordance with an embodiment;

FIG. 3-G depicts aspects of using the model of FIG. 3-F to encapsulateservices in accordance with an embodiment;

FIG. 3-H depicts aspects of a layered virtual machine in accordance withan embodiment;

FIGS. 3-I to 3-K depict three basic service instance interactionpatterns in accordance with an embodiment;

FIG. 3-L depicts aspects of exemplary request processing interactions inaccordance with an embodiment;

FIG. 3-M depicts aspects of an exemplary distributed request processingsystem in accordance with an embodiment;

FIG. 3-N shows an exemplary request collection lattice withunparameterized specific behaviors in accordance with an embodiment;

FIG. 3-O shows an exemplary request collection lattice withparameterized generic behaviors

FIG. 3-P shows an exemplary request collection lattice with mixedparameterization styles in accordance with an embodiment;

FIG. 3-Q is a flow chart showing an exemplary process for determining afunction P* that can be efficiently computed at thecluster/super-cluster level.

FIG. 3-R is a graph showing peering policy refinements for resources.

FIG. 4-A to 4-L show logical organization of various components of anexemplary CDN in accordance with an embodiment;

FIGS. 5-A and 5-B depict cache cluster sites in an exemplary CDN inaccordance with an embodiment;

FIGS. 5-C and 5-D depict cache clusters in the cache cluster sites ofFIGS. 5-A and 5-B in accordance with an embodiment;

FIG. 5-E depicts an exemplary cache cluster site in an exemplary CDN inaccordance with an embodiment;

FIGS. 6-A to 6-F depict various organizations and configurations ofcomponents of exemplary CDNs in accordance with an embodiment;

FIGS. 7-A to 7-C depict aspects of event logging in exemplary CDNs inaccordance with an embodiment;

FIGS. 8-A to 8-D, 9-A to 9-B, and 10-A to 10-E depict aspects ofreducers and collectors in exemplary CDNs in accordance with anembodiment;

FIG. 11 shows interactions between component services of an exemplaryCDN in accordance with an embodiment;

FIGS. 12-A to 12-E depict exemplary uses of feedback in exemplary CDNsin accordance with an embodiment;

FIGS. 13-A to 13-F depict logical aspects of information used by variousservices in exemplary CDNs in accordance with an embodiment;

FIGS. 14-A to 14-F depict aspects of exemplary control mechanisms inexemplary CDNs in accordance with an embodiment;

FIG. 15 shows aspects of exemplary request-response processing inexemplary CDNs in accordance with an embodiment;

FIGS. 15A to 15-I show aspects of sequences and sequence processing

FIG. 16-A to 16-D show examples of sequencers and handlers in accordancewith an embodiment;

FIG. 17 is a flow chart showing exemplary request-response processing inexemplary CDNs in accordance with an embodiment;

FIG. 18 shows interaction between components of an exemplary CDN inaccordance with an embodiment;

FIG. 19 shows the logical structure of aspects of a typical cache inexemplary CDNs in accordance with an embodiment;

FIGS. 20 to 21 depict various tables and databases used by a CDN inaccordance with an embodiment;

FIGS. 22-A to 22-C is a flow chart describing exemplary request-responseprocessing flow in exemplary CDNs in accordance with an embodiment;

FIGS. 23-A to 23-I depict aspects of peering and load balancing inexemplary CDNs in accordance with an embodiment;

FIGS. 24-A to 24-K are flow charts depicts aspects of starting andrunning services in exemplary CDNs in accordance with an embodiment;

FIG. 24-L is a flow chart showing an exemplary process of adding a newmachine server to an exemplary CDN in accordance with an embodiment;

FIGS. 25-A to 25-F describe aspects of an executive system of exemplaryCDNs in accordance with an embodiment;

FIG. 26-A to 26-C depict aspects of computing in exemplary CDNs inaccordance with an embodiment;

FIG. 27-A depicts aspects of configuration of exemplary CDNs inaccordance with an embodiment;

FIG. 27-B shows an example of control resource generation anddistribution in an exemplary CDN in accordance with an embodiment;

FIG. 27-C shows an example of template distribution in an exemplary CDNin accordance with an embodiment;

FIG. 27-D depicts aspects of a software application operating on anorigin server to establish one or more channels to one or more CDservices in the CDN in accordance with an embodiment;

FIG. 27-E is a flowchart showing exemplary operation of an origin-serverside application of FIG. 27-D in accordance with an embodiment;

FIG. 28—shows an example of object derivation in accordance with anembodiment;

FIG. 29 shows an exemplary CDN deployment in accordance with anembodiment;

FIGS. 30-A to 30-H relate to aspects of invalidation in accordance withan embodiment;

FIGS. 31-A to 31-B relate to aspects of clustering; and

FIGS. 32-A to 32-C relate to aspects of beacon services in accordancewith an embodiment.

DETAILED DESCRIPTION OF THE PRESENTLY PREFERRED EXEMPLARY EMBODIMENTSGlossary

As used herein, unless used otherwise, the following terms orabbreviations have the following meanings:

API means Application Program(ing) Interface;

CCS means Customer Configuration Script;

CD means Content Delivery;

CDN means Content Delivery Network;

CNAME means Canonical Name;

DNS means Domain Name System;

FQDN means Fully Qualified Domain Name;

FTP means File Transfer Protocol;

GCO means Global Configuration Object;

HTTP means Hyper Text Transfer Protocol;

HTTPS means HTTP Secure;

IP means Internet Protocol;

IPv4 means Internet Protocol Version 4;

IPv6 means Internet Protocol Version 6;

IP address means an address used in the Internet Protocol, includingboth IPv4 and IPv6, to identify electronic devices such as servers andthe like;

LCO means layer configuration object;

LRU means Least Recently Used;

LVM means layered virtual machine;

NDC means Network of Data Collectors;

NDP means Neighbor Discovery Protocol;

NDR means network of data reducers;

NIC means network interface card/controller;

NS means Name Server;

NTP means Network Time Protocol;

PKI means Public Key Infrastructure;

QoS means quality of service;

RCL means request collection lattice;

SSL means Secure Sockets Layer;

SVM means service virtual machine;

TCP means Transmission Control Protocol;

TRC means terminal request collection;

TTL means time to live;

URI means Uniform Resource Identifier;

URL means Uniform Resource Locator; and

UTC means coordinated universal time.

Background and Overview

A content delivery network (CDN) distributes content (e.g., resources)efficiently to clients on behalf of one or more content providers,preferably via a public Internet. Content providers provide theircontent (e.g., resources) via origin sources (origin servers ororigins), and a CDN can also provide an over-the-top transport mechanismfor efficiently sending content in the reverse direction—from a clientto an origin server. Both end-users (clients) and content providersbenefit from using a CDN. Using a CDN, a content provider is able totake pressure off (and thereby reduce the load on) its own servers(e.g., its origin servers). Clients benefit by being able to obtaincontent with fewer delays.

End Users and Subscribers

In the following description, an end user is an entity (e.g., person ororganization) that ultimately consumes some Internet service (e.g., aweb site, streaming service, etc.) provided by a service providerentity. This provider entity is sometimes referred to as a subscriber inthis description because they subscribe to CDN services in order toefficiently deliver their content, e.g., from their origins to theirconsumers. A CDN may provide value-added mediation (e.g., caching,transformation, etc.) between its subscribers and their end-users.

Clients and Origins

As used herein, clients are agents (e.g., browsers, set-top boxes, orother applications) used, e.g., by end users to issue requests (e.g.,DNS and HTTP requests) within the system. When no CDN or otherintermediaries are in use, such requests may go directly to thesubscriber's own servers (e.g., their origin servers) or to othercomponents in the Internet. When a content provider subscribes to CDservices (described below), various requests may go to intermediate CDservices that may map the end-user requests to origin requests, possiblytransforming and caching content along the way.

Typically, each distinct origin (e.g., origin server) is associated withone subscriber, but a subscriber may be associated with any number oforigins, including subscriber-owned and CDN provided origins.

The physical origins with which the CDN interacts may actually beintermediaries that acquire content from a chain of intermediaries,perhaps, e.g., elements of a separate content acquisition system thatultimately terminates at a subscriber's actual origin servers. As far asthe internals of the CDN are concerned, however, the origin is thatservice outside the system boundary from which content is directlyacquired.

Logical Organization

Services, Service Instances, and Machines

As used herein, a “service instance” refers to a process or set ofprocesses (e.g., long-running or interrupt driven) running on a singlemachine. As used herein, the term “machine” refers to any generalpurpose or special purpose computer device including one or moreprocessors, memory, etc. Those of ordinary skill in the art will realizeand understand, upon reading this description, that the term “machine”is not intended to limit the scope of anything described herein in anyway.

One or more service instances (of the same or different service types)may run on single machine, but a service instance is the execution of asingle service implementation. As used herein, “service implementation”refers to a particular version of the software and fixed data thatimplement the single service instance. A service or serviceimplementation may be considered to be a mechanism (e.g., softwareand/or hardware, alone or in combination) that runs on a machine andthat provides one or more functionalities or pieces of functionality.

A service may be a component and may run on one or more processors ormachines. Multiple distinct services may run, entirely or in part, onthe same processor or machine. The various CD services may thus also bereferred to as CD components.

Those of ordinary skill in the art will realize and understand, uponreading this description, that the term “service” may refer to a“service instance” of that kind of service.

In some cases, it may be useful or necessary to distinguish between thecode (e.g., software) for a service and an actual running version of theservice. For the sake of this description, the code corresponding to aservice is sometimes referred to as an application or application codefor that service. Those of ordinary skill in the art will realize andunderstand, upon reading this description, that a machine may have codefor a particular service (e.g., in a local storage of that machine)without having that service running on that machine. Thus, e.g., amachine may have the application code (software) for a collector serviceeven though that machine does not have an instance of the collectorservice running. The application code for a service may be CDN resource(i.e., a resource for which the CDN is the origin).

There is no requirement that services running on a particular machine beof the same type. There is also no requirement that the services runningon a particular machine, even if of the same type, be configured in thesame manner, or be the same version. Thus, e.g., a particular machinemay run two collector services, each configured differently. As anotherexample, a particular machine may run a reducer service and a collectorservice.

Categorizing Services

A CDN may, in some aspects, be considered to consist of a collection ofmutually interconnected services of various types. FIG. 1-A depicts anexemplary categorization of major service types, and divides them intooverlapping categories, namely infrastructure services, deliveryservices, and other ancillary services. Infrastructure services mayinclude, e.g., services for configuration and control (to command andcontrol aspects of the CDN), and services for data reduction andcollection (to observe aspects of the CDN). These services support theexistence of the delivery services, whose existence may be considered tobe a primary purpose of the overall CDN.

Delivery services may include, e.g., rendezvous services, cachingservices, streaming services, object services, and compute services. Theancillary services may include fill services, origin services, andstorage services. As shown in the drawing in FIG. 1-A, some of theancillary services (e.g., fill, origin, and storage) may alsoconveniently by considered infrastructure and/or delivery services. Itshould be appreciated that the categorization of services in FIG. 1-A ismade in part for the purposes of their description, and thatdifferent/other categorizations may be made. In accordance with anembodiment, the delivery services are themselves also used asimplementation mechanisms in support of infrastructure services.

Although not required, in preferred CDN implementations, it will likelybe the case that, for most service types, service instances will not beisolated but will, instead, be grouped in some manner (e.g., intohierarchies or lattices) containing multiple instances of that servicetype. Thus, e.g., a CDN may comprise groupings of the various types ofservices (e.g., a grouping of control services, a grouping of reductionservices, etc.) These homogenous groupings may include homogenoussub-groupings of services of the same type. Generally, these homogenousgroupings form networks, generally comprising subnetworks.

Typical interaction patterns and peering relationships between servicesof the same and different types impose not only structure on thetopology of a local service neighborhood but also on the topology ofinteractions between the homogenous subnetworks. These subnetworks maybe internally connected or consist of isolated smaller subnetworks. Ingeneral, for service type T, this description will refer to the Tnetwork as that subnetwork of the CDN consisting of all serviceinstances of type T, regardless of whether or not the correspondingsubnetworks of type T are actually interconnected. Thus, e.g., therendezvous network (for the rendezvous service type) refers to thesubnetwork of the CDN consisting of all rendezvous service instances,regardless of whether or not the corresponding rendezvous servicesubnetworks are actually interconnected.

In general, for service type T, as used herein, the “T service(s)” or “Tsystem” refers to the collection of services of type T, regardless ofwhether or how those services are connected. Thus, e.g., the “reducerservices” refers to the collection of CD services of the CDN consistingof all reducer service instances, regardless of whether or not thecorresponding reducer services (or service instances) are actuallyconnected, and, if connected, regardless of how they are connected.Similarly, e.g., the “collector system” refers to the collection of CDservices of the CDN consisting of all collector service instances,regardless of whether or not the corresponding collector services (orservice instances) are actually connected, and, if connected, regardlessof how they are connected; etc.

As used herein, a particular service of type T running on one or moremachines may also be referred to as a “T” or a “T mechanism.” Thus arendezvous service instance running on one or more machines may also bereferred to as a rendezvous mechanism; a control service instancerunning on one or more machines may also be referred to as a controlleror control mechanism; a collecting (or collector) service instancerunning on one or more machines may also be referred to as a collectoror collector mechanism; and a reducer service instance running on one ormore machines may also be referred to as a reducer or reducer mechanism.

It should be appreciated that as a particular machine may be runningmore than one kind of service, the naming of a service instance on aparticular machine does not limit the machine from running other typesof services.

Information Types

Each service or kind of service may consume and/or produce data, and, inaddition to being categorized by CDN functionality (e.g., namelyinfrastructure services and delivery services above), a service type maybe defined or categorized by the kind(s) of information it producesand/or consumes. In one exemplary high-level categorization of services,services are categorized based on five different kinds of informationthat services might produce or consume are defined, as shown in thefollowing table (Table 1):

TABLE 1 Service Categorization Category Description 1 (Abstract) Anyinformation that can be delivered from server to client. Delivery 2Configuration Relatively static policies and parameter settings thattypically originate from outside the network and constrain theacceptable behavior of the network. 3 Control Time-varying instructions,typically generated within the network, to command specific servicebehaviors within the network. 4 Events Streams (preferably, continuous)of data that capture observations, measurements and actual actionsperformed by services at specific points in time and/or space in oraround the network. 5 State Cumulative snapshots of stored informationcollected over some interval of time and/or space in or around thenetwork.

Each service or kind of service may consume and/or produce various kindsof data. Operation of each service or kind of service may depend oncontrol information that service receives. As part of the operation(normal or otherwise) of each service or kind of service, a service mayproduce information corresponding to events relating to that service(e.g., an event sequence corresponding to events relating to thatservice). For some services or kinds of services, the data they consumeand/or produce may be or include event data. Each service or kind ofservice may obtain state information from other CDN services orcomponents and may generate state information for use by other CDNservices or components. Each service may interact with other services orkinds of services.

FIG. 1-B shows a generic CD service instance for each kind of service ina CDN along with a possible set of information flows (based on theservice categorization in Table 1 above).

As shown in FIG. 1-B, each service instance in a CDN may consume (takein) control information (denoted CTRL in the drawing) and may produce(e.g., emit or provide) control information as an output (denoted CTRL′in the drawing). Each service instance may consume state information(denoted S in the drawing) and may produce state information (denoted S′in the drawing) as an output. Each service instance may consume events(denoted E in the drawing) and may produce events (denoted E′ in thedrawing). Each service instance may consume configuration information(denoted CFIG in the drawing) and may produce configuration information(denoted CFIG′ in the drawing). Each service instance may consumedelivery information (denoted D in the drawing) and may produce deliveryinformation (denoted D′ in the drawing).

It should be appreciated that not every service instance or kind ofservice instance needs to consume each kind of input (control, state,events, config, etc.) or to produce each kind of output. Furthermore, itshould be appreciated that not every service instance needs to use ortransform or modify any/all of its inputs (e.g., a service endpoint maypass information through without transformation of that information).So, e.g., with reference to FIG. 1-B, in some cases CTRL=CTRL′ and/orS=S′ and/or E=E′, etc.

As used herein, in the context of data consumed or produced by aservice, the term “state” refers to “state information,” the term“events” refers to “events information,” the term “config.” (or“configuration”) refers to “configuration information,” and the term“control” refers to “control information.” When used in the context ofconfiguration information, the word “configuration” is sometimesabbreviated herein to “config” (without a period at the end of theword).

A producer of a certain kind of information is referred to as a “source”of that kind of information, and a consumer of a certain kind ofinformation is referred to as a “sink” of that kind of information.Thus, e.g., a producer of state (or state information) may be referredto as a “state source,” a producer of configuration information may bereferred to as a “config source,” etc.; a consumer of state may bereferred to as a “state sink,” a consumer of configuration informationmay be referred to as a “config sink,” and so on.

Considering possible combinations of information flows provides a numberof different ways to categorize services. A set of trivial service types(shown in FIG. 1-C) may be defined by constraining each service to haveone kind of information flow in one direction (i.e., to be a source or asink of one kind of information). The five information categoriesdelivery, configuration, control, events, and state (Table 1 above),give the ten trivial service types shown in FIG. 1-C.

Using these trivial service types (FIG. 1-C) as the basis, typicalcombinations of flows expected to occur in CD services may be defined,leading to the exemplary definition/taxonomy of the infrastructureservices and (primary) delivery services shown in FIG. 1-D. As shown inthe drawing in FIG. 1-D, CD services may be categorized as deliverysources and/or delivery sinks A delivery source may be a config source,a control source, an event source, and/or a state source. A deliverysource that is a config source is a delivery source of configinformation; a delivery source that is a control source is a deliverysource of control information, a delivery source that is an event sourceis a delivery source of event information, and a delivery source that isa state source is a delivery source of state information.

A delivery sink may be a config sink, a control sink, an event sink,and/or a state sink. A delivery sink that is a config sink is a deliverysink of config information; a delivery sink that is a control sink is adelivery sink of control information, a delivery sink that is an eventsink is a delivery sink of event information, and a delivery sink thatis a state sink is a delivery sink of state information.

A minimal CD service is an event source and a control sink. That is, aminimal CD service is a delivery source of event information and adelivery sink of control information.

A (primary) delivery service is a minimal CD service (and thus inheritsthe taxonomic properties of a minimal CD service). Similarly, anancillary CD service such as, e.g., a fill service, an origin service,and a storage service, is a minimal CD service and thus inherits thetaxonomic properties of a minimal CD service.

Thus, a configuration service may be categorized, according to thetaxonomy in FIG. 1-D, as a config source, and a config sink. Aconfiguration service may also be categorized as a minimal CD service,whereby it is also categorized as an event source and a control sink. Aconfiguration service is a delivery source (of config information) and adelivery sink of config information.

A control service may be categorized, according to the taxonomy in FIG.1-D, as a minimal CD service (and thereby an event source and a controlsink), as a config sink, and as a control source. A control service is adelivery sink of config information and a delivery source of controlinformation.

A reducer service may be categorized, according to the taxonomy in FIG.1-D, as a minimal CD service (and thereby an event source and a controlsink), and as an event sink. A collector service may be categorized,according to the taxonomy in FIG. 1-D, as a minimal CD service (andthereby an event source and a control sink), and as an event sink, astate source, and a state sink.

Caching services, rendezvous services, object distribution services, andcompute distribution services are each (primary) delivery services, andare therefore minimal CD services, according to the exemplary taxonomyin FIG. 1-D.

Similarly, fill services, origin services, and storage services may alsobe considered minimal CD services, according to the exemplary taxonomyin FIG. 1-D.

As may be seen from the diagram in FIG. 1-D, in some aspects to be a CDservice means to be enmeshed in the network of other CD services. TheMinimal CD Service in the diagram is both a Control Sink and an EventSource, meaning that all CD services consume control information andgenerate events.

Those of ordinary skill in the art will realize and understand, uponreading this description, that this example taxonomy shown in FIG. 1-Dshould be taken as a general guideline for naming services in usefulways that capture their essential similarities and differences, thoughit should not be used to limit the scope of the system in any way. Whilethe taxonomy captures the names and definitions of idealized services,it should be appreciated that actual service implementations may strayfrom these constraints for practical reasons. Most actual infrastructureservices will involve more information exchanges than shown above, forexample. For example, control services may consume state informationfrom collectors, and primary delivery services may consume both eventstreams and collector state. These variations may be considered subtypesof the versions shown earlier. A more realistic set of information flowsbetween the basic CD service types is shown in FIG. 1-E (discussedbelow). This set of relationships can be considered as existing betweenindividual services or between entire subnetworks of homogeneousservices (as can be seen by comparing the diagrams in FIG. 1-E and FIG.1-F).

Those of ordinary skill in the art will realize and understand, uponreading this description, that several kinds of delivery services arereferred to herein (as noted by the “Abstract” prefix in “(Abstract)Delivery” above). When not explicitly stated, the kind of deliveryservice may be determined from the context.

The (abstract) delivery service category is an umbrella term for allinformation exchanged by services and clients, reflecting the fact thatall services deliver information. This observation leads to the taxonomyof information flows shown in FIG. 1-G, where each of the other fourtypes of information (config, control, events, and state) may beconsidered as special cases of (abstract) delivery information.

Unless stated otherwise or apparent from the context, in the rest ofthis description, however, a delivery service refers to one that isproviding one of the (primary) delivery services that CDNsubscribers/customers use (e.g., caching and rendezvous). Those ofordinary skill in the art will realize and understand, upon reading thisdescription, that this distinction is arbitrary, and may changedepending on the set of services offered to subscribers/customers. Theoffered set of services need not be limited to the current set ofprimary deliver services

The last service variant is (controlled) delivery, referring to anyservice that is being controlled by the network. Those of ordinary skillin the art will realize and understand, upon reading this description,that it may sometimes be useful to distinguish the service beingcontrolled from the services doing the controlling, even though allservices in the CDN are controlled by it.

Logical and Physical Information Flows

Each information flow between two interacting services will typicallyhave an associated direction (or two). The direction of arrows in mostof illustrations here is intended to represent the primary direction inwhich information flows between a source and a sink, and not thephysical path it takes to get there.

For example, the left side of FIG. 1-H depicts a logical flow ofinformation across three services (config service to control service tocontrolled service). It should be appreciated, however, that the flowdepicted in the drawing does not necessarily imply a direct exchange ofinformation between the various services. The right side of FIG. 1-Hshows an example of an actual path through which information might flow,involving intermediate delivery networks (in this example, two specificintermediate delivery networks, object distribution service(s) for theconfig information from the config service to the control service, andcaching service(s) for the control information from the control serviceto the controlled service, in this example). It should also beappreciated that the level of description of the right side of the FIG.1-H is also a logical representation of the data paths for the configand control information.

In addition, those of ordinary skill in the art will realize andunderstand, upon reading this description, that whether logical orphysical, information flow arrows usually do not specify any protocol(s)involved for the information exchange or which side initiates theconversation. Multiple protocols are conceivable and are contemplatedherein, and, in many cases, the same application level protocol could beapplied in multiple ways, e.g., where either side may push or pull. Anexception to this is when a particular protocol is itself a definingfeature of a service (for example, as may be the case with primarydelivery services).

Example CDNs

In some aspects, a CDN may be considered to exist in the context of acollection of origin servers provided by (or for) subscribers of the CDNservice, a set of end-user clients of the content provided bysubscribers through the CDN, a set of internal tools (e.g., tools thatprovision, configure, and monitor subscriber properties), an internalpublic-key infrastructure, and a set of tools provided for use bysubscribers for direct (“self-service”) configuration and monitoring ofthe service to which they are subscribing (see, e.g., FIG. 1-I). Itshould be appreciated that not every CDN need have all of theseelements, services, or components.

For the purposes of this description, all services on the edge of andwithin the CDN cloud shown in FIG. 1-I may be considered part of anexemplary CDN. These services may be distinguished from those outsidethe boundary in that they are themselves configured and controlled byother services within the CDN.

A CDN may thus be considered to be a collection of interacting andinterconnected (or enmeshed) services (or service instances), along withassociated configuration and state information. FIG. 1-J depicts alogical overview of an exemplary CDN 1000 which includes services 1002,configuration information 1004, and state information 1006.

The services 1002 may be categorized or grouped based on their roles orthe kind(s) of service(s) they provided (e.g., as shown in FIG. 1-A).For example, as shown in FIG. 1-J, an exemplary CDN 1000 may includeconfiguration services 1008, control services 1010, collector services1012, reducer services 1014, primary delivery services 1016, andancillary services 1018. Recall that, as used herein, for service typeT, as used herein, the phrase “T services” refers to the collection ofservices of type T, regardless of whether or how those services areconnected. Thus, e.g., the reducer services 1014 refer to the collectionof all reducer service instances, regardless of whether thecorresponding reducer service instances are actually connected, and, ifconnected, regardless of how they are connected.

The configuration services 1008 may include, e.g., services forconfiguration validation, control resource generation, etc. The controlservices 1010 may include, e.g., services for control resourcedistribution, localized feedback control, etc. The collector services1012 may include, e.g., services for monitoring, analytics, popularity,etc. The reducer services 1014 may include, e.g., services for logging,monitoring, alarming, analytics, etc. The primary delivery services 1016may include, e.g., services for rendezvous, caching, storage, compute,etc. The ancillary services 1018 may include, e.g., services forstorage, fill, origin, etc.

Those of ordinary skill in the art will realize and understand, uponreading this description, that different and/or other categorizations ofthese services may be applied. In addition, those of ordinary skill inthe art will realize and understand, upon reading this description, thatthe examples listed above for the various groups of services are merelyexemplary, and that any particular category may include different and/orother services. As noted above, with respect to FIG. 1-A, some of theservices may be categorized in more than one category (e.g.,miscellaneous services may also be categorized as delivery services).

Roles and Flavors

The various CD services that a particular machine is running on behalfof the CDN, or the various roles that a machine may take on for the CDN,may be referred to as the flavor of that machine. A machine may havemultiple flavors and, as will be discussed, a machine may changeflavors.

Provisioning and configuration of machines is described in greaterdetail below.

In some implementations, groups of services (corresponding, e.g., to theservices needed by a particular kind of CDN node) may be named, with thenames corresponding, e.g., to the flavors.

The role(s) that a machine may take or the services that a machine mayprovide in a CDN include: caching services, rendezvous services,controlling services, collecting services, and/or reducing services.

As used herein, one or more machines running a caching service may alsobe referred to as a cache; one or more machines running a rendezvousservice may also be referred to as a rendezvous mechanism or system, oneor more machines running control services may also be referred to as acontroller; one or more machines running collecting services may also bereferred to as a collector or collector mechanism; and one or moremachines running a reducer services may also be referred to as a reduceror reducer mechanism.

CD Service Interactions

FIG. 1-E shows the logical connectivity and flow of different kinds ofinformation (event, control, and state information) between serviceendpoints of the various services or kinds of services of an exemplaryCDN (based, e.g., on the categorization of services in FIG. 1-J). Asshown in FIG. 1-E, configuration service instance endpoints(corresponding to configuration services 1008 in FIG. 1-J) may provideconfiguration information to control service endpoints (corresponding tocontrol services 1010 in FIG. 1-J).

Control service instance endpoints may provide control information (C₁)to collector service instance endpoints (corresponding to collectorservices 1012 in FIG. 1-J), control information (C₂) to reducer serviceendpoints (corresponding to reducer services 1014 in FIG. 1-J), andcontrol information (C₃) to delivery service instance endpoints(corresponding to all delivery services, including primary services 1016in FIG. 1-J). Control services endpoints may also provide controlinformation (C₄) to other control services endpoints and controlinformation (C₅) to configuration service endpoints. The flow of controlinformation is shown in the drawing by solid lines denoted with theletter “C” on each line. It should be appreciated that the letter “C” isused in the drawing as a label, and is not intended to imply any contentor that the control information on the different lines is necessarilythe same information.

As also shown in FIG. 1-E, configuration service endpoints, controlservice endpoints, collector service endpoints, reducer serviceendpoints, and services endpoints, may each provide event data toreducer service endpoints. Reducer service endpoints may consume eventdata from the various service endpoints (including other reducer serviceendpoints) and may provide event data to collector service endpoints.The flow of event information is shown in the drawing by dotted linesdenoted with the letter “E” on each line. It should be appreciated thatthe letter “E” is used in the drawing as a label, and is not intended toimply any content or that the event information on the different linesis necessarily the same event information.

Various components (i.e., service endpoints) may consume and/or producestate information. For example, collector service endpoints may producestate information for other service endpoints, e.g., state informationS₁ for reducer service endpoints, state information S₂ for configurationservices endpoints, state information S₃ for control service endpoints,state information S₄ for collector service endpoints, and stateinformation S₅ for delivery service endpoints. The flow of stateinformation is shown in the drawing by dot-dash lines denoted with theletter “S” on each line. It should be appreciated that the letter “S” isused in the drawing as a label, and is not intended to imply any contentor that the state information on the different lines is necessarily thesame state information.

As can be seen from the flow of information (event data, control data,and state data) in the diagram in FIG. 1-E (and FIG. 1-M), variousservices or components of the CDN can provide feedback to other servicesor components. Such feedback may be based, e.g., on event informationproduced by the components. The CDN (services and components) may usesuch feedback to configure and control CDN operation, at both a localand a global level.

FIG. 1-K shows aspects of the flow in FIG. 1-E (without theconfiguration services, with various flow lines removed and with some ofthe branches relabeled in order to aid this discussion). Similarly, FIG.1-P shows aspects of the flow in FIG. 1-M, (also without theconfiguration services, with various flow lines removed and with some ofthe branches relabeled in order to aid this discussion).

As shown in the drawings in FIGS. 1-K and 1-P, a particular serviceendpoint 1016-A in FIG. 1-K, 1018-A in FIG. 1-P, may provide event data(E) to a reducer endpoint service 1014-A. The reducer endpoint servicemay use this event data (and possibly other event data (E′), e.g., fromother components/services) to provide event data (E″) to collectorendpoint service 1012-A. Collector service 1012-A may use event data(E″) provided by the reducer endpoint service 1014-A to provide stateinformation (S) to a control endpoint service 1010-A as well as stateinformation (denoted S local) to the service endpoint 1016-A. FIGS. 1-Kand 1-P show particular components/endpoints (a service endpoint) inorder to demonstrate localized feedback. It should be appreciated,however, that each type of service endpoint (e.g., control, collector,reducer) may provide information to other components/service endpointsof the same type as well as to other components/service endpoints ofother types, so that the control feedback provided to the serviceendpoints may have been determined based on state and event informationfrom other components/service endpoints.

Those of ordinary skill in the art will realize and understand, uponreading this description, that the information flow (and thus anyfeedback loops) shown in FIGS. 1-E and 1-K may apply equally at localand global levels, and may apply to any and all CDN services andcomponents. Thus, as shown in FIGS. 1-L and 1-O, information may flowbetween the various CDN components shown in FIG. 1-J in the same manneras information flows between service instance endpoints.

Event information from each kind of service may be provided to reducerservices 1014 from each of the other kinds of services. The reducerservices 1014 may provide event information to the collector services1012. Based at least in part on event information provided by thereducer services 1014, the collector services 1012, in turn, may providestate information to control services 1010, configuration services 1008,reducer services 1014, and primary services 1016 (or ancillary services1018). Based at least in part on state information provided by collectorservices 1012, the control services 1010 may provide control informationto the other services.

FIG. 1-E shows canonical service interactions between individual serviceinstances of various types, whereas FIG. 1-L shows interactions andinformation flows between groups of services of the same type or betweenclasses of service types. It should therefore be appreciated thatvarious boxes (labeled 1008, 1010, 1012, 1014, and 1016) in FIG. 1-L mayrepresent multiple services/components of that type. Similarly, FIG. 1-Mshows canonical service interactions between individual serviceinstances of various types, whereas FIG. 1-O shows interactions andinformation flows between groups of services of the same type or betweenclasses of service types. It should therefore be appreciated thatvarious boxes (labeled 1008, 1010, 1012, 1014, and 1018) in FIG. 1-O mayrepresent multiple services/components of that type.

The endpoints of each kind of service (caches, rendezvous, collectors,reducers, control, fill, storage, origins, etc.) may be organized invarious ways. In general, the endpoints of each kind of service form anetwork comprising one or more sub-networks of those endpoints. Thus, aCDN may include at least one cache network of cache services, at leastone rendezvous network of rendezvous services, at least one collectornetwork of collector services, at least one reducer network of reducerservices, and at least one control network of control services. Each ofthese networks may be made up of one or more sub-networks of the sametype of services. The configurations and topologies of the variousnetworks may be dynamic and may differ for different services. Those ofordinary skill in the art will realize and understand, upon reading thisdescription, that a CDN need not have all of the kinds of serviceslisted or described here.

Each box showing services in FIGS. 1-L and 1-O (i.e., boxes labeled1008, 1010, 1012, 1014, 1016, and 1018) may, e.g., comprise a network(one or more subnetworks) of services or components or machinesproviding those services.

Thus, e.g., the box labeled reducer services 1014 may comprise a networkof reducers (or machines or components providing reducer services). Thatis, the reducer services 1014 may comprise a reducer network (one ormore subnetworks) of reducer services, being those subnetworks of theCDN consisting of all service instances of type “reduce.”

Similarly, the box labeled collector services 1012 may comprise anetwork of collectors (or machines or components providing collectorservices). That is, the collector services 1012 may comprise a network(one or more subnetworks) of collector services (the collector network),being those subnetworks of the CDN consisting of all service instancesof type “collector.” Similarly, control services 1010 may comprise acontrol network (one or more subnetworks) of control services, beingthose subnetworks of the CDN consisting of all service instances of type“control.” Similarly, config services 1008 may comprise a config network(one or more subnetworks) of config services, being those subnetworks ofthe CDN consisting of all service instances of type “config,” andsimilarly, the delivery services 1016 (which includes cache services andrendezvous services) may comprise a network (one or more subnetworks) ofsuch services. And similarly, the ancillary services 1018 (which mayinclude fill services, storage services, and origin services) maycomprise one or more networks (or one or more subnetworks) of suchservices.

FIGS. 1-F and 1-N show exemplary information flows between homogeneousservice-type networks.

Thus, event information may flow from any delivery service (1016) ormisc. service (1018) via a network of reducer services 1014 to a networkof collector services 1012. Any of the reducer services in the networkof reducer services 1014 may provide event information to any of thecollector services in the network of collector services 1012. Any of thecollector services in the network of collector services 1012 may providestate information to any of the reducer services 1014 and to controlservices 1010.

Thus are provided various feedback loops that, in an embodiment, operatein real time to control the various services.

Those of ordinary skill in the art will realize and understand, uponreading this description, that, as used herein, the term “real time”means near real time or sufficiently real time. It should be appreciatedthat there are inherent delays built in to the CDN (e.g., based onnetwork traffic and distances), and these delays may cause delays indata reaching various components. Inherent delays in the system do notchange the real-time nature of the data. In some cases, the term“real-time data” may refer to data obtained in sufficient time to makethe data useful in providing feedback.

Although the term “real time” has been used here, it should beappreciated that the system is not limited by this term or by how muchtime is actually taken for data to have an effect on controlinformation. In some cases, real time computation may refer to an onlinecomputation, i.e., a computation which produces its answer(s) as dataarrive, and generally keeps up with continuously arriving data. The term“online” computation is compared to an “offline” or “batch” computation.

Hybrid Services

Although services are generally described as having one role (e.g.,delivery, rendezvous, collector, reducer, etc.), those of ordinary skillin the art will realize and understand, upon reading this description,that hybrid services may be formed by combining the functionality ofvarious services. Hybrid services may be formed from services ofdifferent types or of the same type. For example, a hybrid service maybe formed from a reducer service and a collector service. Hybridservices may be formed from one or more other services, including otherhybrid services. Each device may run one or more services, including oneor more hybrid services.

Events & Event Information

As noted, each service may produce information corresponding to eventsrelating to that service (e.g., an event sequence corresponding toevents relating to that service). An event is information (e.g., anoccurrence) associated with an entity and an associated (local) time forthat information. Thus, at a local level, i.e., at an entity (e.g.,service or device or machine) that produces an event, an event may beconsidered as a <time, information> pair. An event stream is an orderedlist of events, preferably time ordered, or at least partially timeordered. The time associated with an event is, at least initially,presumed to be the time on the entity on which that event occurred or atime on the entity on which the information associated with that eventwas current, as determined using a local clock on or associated withthat entity. Events in event streams preferably include some form ofidentification of the origin or source of the event (e.g., anidentification of the entity originally producing the event). Thus,outside of the entity that produces an event, an event may be consideredas a tuple <entity ID; time, information>, where “entity ID” identifiesthe entity that produced the event specified in the “information” at thelocal time specified by the “time” field. Preferably the entity IDuniquely identifies the entity (e.g., a service instance) within theCDN. The time value is time at which the event occurred (or theinformation was generated), as determined by the entity. That is, thetime value is a local time of the event at the entity. In preferredimplementations, local time is considered to be coordinated universaltime (UTC) for all CDN entities/services.

The information associated with an event may include information aboutthe status of an entity (e.g., load information, etc.), informationabout the health of an entity (e.g., hardware status, etc.), informationabout operation of the entity in connection with its role in the CDN(e.g., in the case of a server, what content it has been requested toserve, what content it has served, how much of particular content itserved, what content has been requested from a peer, etc., and in thecase of a DNS service, what name resolutions it has been requested tomake, etc.), etc. Those of ordinary skill in the art will realize andunderstand, upon reading this description, that different and/or otheroccurrences or items of information may be included in events.

An event stream is a sequence of events, preferably ordered. Streams aregenerally considered to be never ending, in that they have a startingpoint but no assumed endpoint.

Service Management

Service management involves a set of mechanisms through which instancesof service types are installed and launched on specific machines,preferably in response to signals (control information) from the controlnetwork.

Provisioning and Configuration

With reference to the drawing in FIG. 2-A, a machine 300 has coreprograms 302 which may include an operating system (OS) kernel 304 andpossibly other core programs 306. The computer 300 may run or supportone or more services 308, denoted S0, S1 . . . Sk in the drawing. Forexample, a particular computer may run one or more of: reducer services,collector services, caching services, rendezvous services, monitoringservices, etc.

Autognome and Repoman

Each machine is preferably initially configured with at least sufficientcore program(s) 302 and at least one provisioning service S0 (i.e., theapplication code for at least one provisioning service S0) to enableinitial provisioning of the machine within the CDN. The provisioningservice S0 may then be used to provision the machine, both for initialprovisioning and, potentially, for ongoing provisioning, configurationand reconfiguration.

In some cases the configuration/provisioning service S0 may also bereferred to herein as “Autognome.” Autognome (S0) is a preferablylightweight service, running on all CDN machines, that provides part ofa system for autonomic control of the network. The phrase “autonomiccontrol” refers to changes in behavior that occur spontaneously as aresult of stimuli internal to the network, as opposed to control drivenfrom conscious, manual, knob-turning and the like. At the level ofindividual machines providing services in the CDN, autonomic controlinvolves continuous reaction to service reconfiguration commandsgenerated elsewhere in the network (e.g., by control nodes), andAutognome is the service that implements this reaction. It should beappreciated that while the system may use autonomic control, this doesnot preclude the use of manual control, e.g., by network operators. Itshould be appreciated that, as used here, autonomic may also refer tothere being no requirement for a human to intervene on a particularmachine to effect a configuration change even if the change wascommanded by some human intervention elsewhere (e.g., somewhere in thecontrol network) which causes Autognome to take the necessary actionsautonomously to get into the right configuration.

The Autognome (S0) relies on another service (referred to here as“Repoman” or R0) to provide the assets (e.g., the software) Autognomeneeds to install. The Repoman service (R0) provides the ability topublish and retrieve the software artifacts needed for a specificversion of any service type implementation, along with dependencyinformation between services and metadata about each service version'sstate machine. A service version is generally defined by a list ofartifacts to install, a method for installing them, and a set of otherservices that need to be installed (or that cannot be installed) on thesame machine. The state machine defines a list of states with commandsthat Autognome (S0) can issue to move the service from one state toanother. Most services will have at least two states reflecting whetherthe service is stopped or running, but some services may have more.

Service and Constellation States

Each service has a hierarchy of state values, including a singleservice-level state, an endpoint-level state for each unique endpoint itlistens to, and a state per layer per terminal request collection(defined below) that it responds to. The value of each of these statevariables is taken from a discrete set of states that depends on thetype of state variable, the type of service, and the serviceimplementation that the service instance is running

A service can be commanded to a different state (at the service level,endpoint, or request collection level) either via an argument in thecommand that launches the service, via control information retrieved bythe service directly from the control network, or via a command issueddirectly from Autognome or some other agent to the service. Servicestates may also change as a side effect of normal request processing.The actual mechanisms available, and the meaning of different states aredependent on the service type. Autognome, however, preferably onlyattempts to control service level state of a service.

The ability of Autognome to probe current states locally may be limitedand depend on what has been designed into the service implementation,and in some cases the only reliable feedback loop will be from errorsignals based on external monitoring received via Autognome's controlfeed.

Service constellations may also have state machines, either definedimplicitly by the set of state machines for all services in theconstellation (where the state of the constellation is the vector ofstates for each of the services), or defined explicitly. Explicitlydefined state machines at the constellation level are useful when notall combinations of sub-states make sense, and/or when there iscoordination needed between state transitions across multiple services.

In general, the top-level state machine operated by Autognome maycorrespond to a hierarchy of state machines, each of which may beinternally hierarchical and probabilistic. In the probabilistic case,commands issued by Autognome are known only to put the service in sometarget state with some probability, and probes update the probabilitydistribution based on observations and the believed prior probability.Autognome tracks the state of each service as the most probable statebased on its history of commands and the result of probes.

Since the services on a machine can be modified (e.g., stopped, started,etc.) on the fly, each CD service preferably accepts options to start,and stop. CD services may also accept options to restart (stop and thenstart), check, update, and query. The actual set of options depends onthe service level state machine configured for that serviceimplementation.

Service Constellations, Flavors, and Roles

A service constellation refers to an identifiable collection of servicespecifications, where each service specification defines the softwareartifact versions required and the state machine of the service (a listof states, executable transitions between states, and executable stateprobes that Autognome can use to measure and control service state). Aservice collection may be named.

Although service constellations can be defined on the fly, in some casesit may be useful to define them in advance and give them names. The term“flavor” is used herein to refer to such a named service constellation.A flavor may be considered to be shorthand for a symbolically namedservice constellation.

A service specification may also specify additional required services orservice constellations. An Autognome configuration preferably specifiesa list of one or more constellations, and optionally, a list ofservice-specific states. Autognome's job is to install all dependencies(including unmentioned but implicitly required service constellations orservices), launch the necessary services, and usher them through totheir specified end states.

A machine may also have multiple roles, each of which represents themachine's functional role and its relationships to other machines in oneor more larger subnetworks of machines. Each role maps to a serviceconstellation (or flavor) expected of machines performing that role in aparticular kind of network. Thus a machine's flavors or serviceconstellations may, in some cases, be influenced indirectly by the rolesit performs.

While a single machine can be instructed to have multiple roles,flavors, and service constellations, it should be appreciated that rolesand flavors ultimately reduce to service constellations, and that thecomposition of multiple service constellations is itself a serviceconstellation. Therefore, there is one service constellation thatrepresents the set of services running on a machine at any given time,and this service constellation is computed dynamically from the initiallist of roles, flavors, and/or constellations Autognome is configured tolaunch. This computation may be performed partly by repoman and partlyby Autognome. Due to the way service constellations are computed and thedynamic nature of the inputs, the ultimate service constellationlaunched on a machine may not necessarily correspond exactly to anypreconfigured service constellation, role, or flavor.

Autognome's View of Services

Autognome has an abstract view of services and constellations (groups)of services. The definition of services, constellations, and theirassociated state machines is defined elsewhere (most likely in theconfiguration network, with references to specific software packagebundles needed for specific services, which would be retrieved fromRepoman). A state machine for a service defines a discrete set of stateswith commands for transitioning between specific states. In addition,routes may be defined to map indirect state transitions into direct,next-hop state transitions. Commands for state transitions would haverate-limiting delays associated with them, and an additional set ofstate-dependent commands would be defined to allow autognome to probefor the current value of a service state (which could result in somelocal action or could result in a request to a remote service, like acollector, that is observing the effects of services running on thismachine).

All state probe and transition commands are assumed to be idempotent ifsuccessful, but not guaranteed to be successful. In other words, anynumber of commands (with appropriate delays) specified to move a servicefrom state A to state B must either leave it in state A or put it instate B and have no effect if the service is neither in state A nor inB. Autognome should also assume that services can spuriously changestate in response to other stimuli other than Autognome commands.Whether or not active state monitoring is the responsibility of anAutognome instance (or whether that monitoring is done by some otheragent and the results fed back into Autognome's configuration) isvariable, depending on the configuration of that Autognome instance(which might depend on the nature of the services to be monitored).

Each service's state machine as viewed by Autognome is expected to be anabstraction of a more detailed internal state, and it is a servicedesign and implementation decision as to how much of this internal statemust be represented to Autognome, how much more might be represented ininternal states visible to the control network but not to Autognome, andhow much variation is purely internal to the service. Thus the number ofstates in the Autognome view of a service is arbitrary as far asautognome is concerned but likely to be small (usually two).

As a corollary to all this, autognome does not care whether a servicecorresponds to a single process or many processes, since its interactionwith services is done in terms of state probe and state transitioncommands that it is given. This also leads to the notion that a“service” could be defined as a collection of subservices, with a statemachine that is based on the states of subservices. This aspect would beuseful (though not necessarily) built into autognome in order to enablethe probing of a certain composite state to be defined as probing a listof sub services for their individual states, and similarly for statetransitions.

A Service's View of Autognome

Services may, but need not know, anything about the existence ofautognome. As such, services that are developed outside of the frameworkmay be integrated with it. A service's configuration must define thestate machine abstraction of the actual service implementation alongwith other dependency information.

Autognome Vs. Control Services

Autognome exerts a controlling influence on the services it launches,but Autognome itself is not defined as a control service. It should beappreciated that this is a matter of definition and does not affect thatmanner in which Autognome or the control services operate.

Configuration Levels

Configuration may occur at multiple levels on any given machine, fromthe relatively static platform installation (e.g., initiatedout-of-band) to the highly dynamic (re)configuration of a constellationof running services. The function of Autognome (S0) may be describedwith respect to layers or levels of operation of a machine, and withreference to FIG. 2-B.

Configuration Level 0 (Platform Provisioning)

Level 0 is assumed to exist and to have been configured in advance inthe initial provisioning of the system, out-of-band with respect toAutognome (S0). The existence of some version of Autognome itself ispreferably established as a service as part of Level 0 (this version ofAutognome is denoted service S0 in FIG. 2-A). The only requirements ofLevel 0 (other than the presence of some version of Autognome) are theplatform facilities needed to run Autognome and any platformconfigurations which Autognome is not able or allowed to alterdynamically (e.g., at least some core programs 302, likely to includethe base OS distribution and a particular kernel 304 and set of kernelparameters, though kernel changes could also be initiated by Autognome).

Configuration Level 1 (Autognome) Self-Reconfiguration

The set of software installation steps that constitute formation ofLevel 0 is essentially arbitrary, limited only by what the currentinstallation of Autognome is able and authorized to change. Anythingthat Autognome is unable or unauthorized to change falls within Layer 0,with the exception of Autognome itself (which must be initiallyinstalled in Level 0 but may be changed in Level 1).

Level 1 establishes the configuration of Autognome itself. Onceinitially installed (established) in Level 0, Autognome can reconfigureitself to run any version older or newer than the currently installedversion on the machine, and other Autognome parameters can bedynamically adjusted.

Configuration Level 2 (Service Provisioning)

Level 2 (Service Provisioning) establishes the other services (S1 . . .Sk in FIG. 2-A) that need to be active on the machine and their initialconfiguration environments. Part of Autognome's configuration is alsothe constellation of services to run. With reference to FIG. 2-C,Autognome may implement Level 2 by retrieving the necessary softwareartifacts or packages from Repoman and installing them on the machine.

Each service may have dependencies on other services and on elements oflower layers, so establishing a particular set of services may involveboth destructive changes to the current configuration (stoppingservices, uninstalling packages) as well as constructive changes(installing packages, (re)starting services) for both the explicitlymentioned services and for other dependencies. Certain services maysupport additional commands that Autognome can issue without restartingthe services. These commands may involve writing files or issuing directrequests (e.g., via HTTP or other protocols) to local services.

Configuration Level 3 (Service Instantiation)

In Configuration Level 3 Autognome's next responsibility is to stop andstart services, provide initial service configurations to enable them toreconfigure themselves later, and guide them into their target states asspecified by the service constellation.

Level 4 (Service Reconfiguration)

Level 4 (Service Reconfiguration) refers to service specific dynamicconfiguration that falls outside the scope of Autognome's actions inLayer 2. Services are assumed to act on additional (re)configurationcommands (e.g., from control resources pulled from the controlmechanism, or from other sources) as appropriate for the service. Forexample, a cache service may autonomously consume control resources fromthe control mechanism and thereby adjust its behavior dynamically,without any knowledge of or involvement from Autognome. Autognome has norole in this layer, and it is mentioned here to clarify the fact thatAutognome need not be the source of all configuration information, norneed it be the impetus for all dynamic configuration changes.Autognome's focus is on the configuration of services running on amachine, and on the service-specific state of each service.

Configuration Monitoring

All Autognome actions regarding configuration state changes may belogged as events to an appropriate reducer service, provided Autognomeis configured to do so. These event streams can be reduced in the usualfashion to get global, real-time feedback on the changes taking place inthe network.

Health and Load Monitoring

Autognome is preferably implemented as a small service with a few simplefunctions—to install, start, probe, and stop services. Autognome'sability to monitor service state may be limited to its ability toexecute configured probe commands that allow it to infer the state ofeach service on the machine at any time (or the probability of being ineach state), and it reports only service level state and configurationchanges. This level of monitoring is sufficient for autognome buttypically not sufficient for general health and load monitoring. Whenmore elaborate monitoring functionality is needed (as it often will be),additional services whose sole purpose is monitoring may be added to theservice constellation, and autognome will take care of installing andrunning them. Such services will typically provide their monitoring datain the form of events delivered to reducers. In addition, each servicerunning on the machine (including autognome) will typically provide itsown event stream that can also be used as a source of monitoring data.

It should thus be appreciated that Autognome is itself a serviceinstance (see FIG. 1-B), and, as such may take control, state and eventinformation as inputs, and may produce control, state and eventinformation as outputs. Autognome corresponds, e.g., to a service 1016-Ain FIG. 1-K (or 1018-A in FIG. 1-P). Thus, as shown in FIG. 2-D, anAutognome service (S0-A) may take as input control information (C) fromcontrol endpoints and produce event information (E) to be provided toreducer endpoint(s).

It should be appreciated that Autognome need not directly provide anyadditional monitoring functionality of the services it launches, otherthan the service state changes just described. When such functionalityis needed (as it typically will be), additional services whose solepurpose is monitoring may be added to the service constellation, andAutognome will take care of installing and running them.

Auto(g)nomic Adapters

An autonomic adapter is an adapter that may be provided betweenAutognome and a foreign service component that does not support theinterface expected by Autognome, at least with respect to the manner inwhich configuration updates and state changes work (a non-CD service).The adaptor makes the non-CD service look like a service to Autognome atleast with respect to configuration updates and state changes. Thecomposition of the foreign service component and the autonomic adapterresults in a CD-service, thereby allowing software components that werenot designed to be enmeshed as a CD-service to be enmeshed. The adapteris able to retrieve configuration updates, launch the service, andreport service state changes by reading and writing files, settingenvironment variables, and running other commands that the foreignservice component provides.

Object Distribution Introduction to Object Distribution

The network of object distribution services provides distributednamespaces of versioned objects. An object in this context is a mappingfrom a key or identity in some namespace to a set of versioned values.Objects are distributed in the sense that two object service nodes(simply “nodes”) may concurrently read or write the same object, and asa result, an object may have conflicting values in different parts ofthe network or even conflicting value versions for the same object atone location. The function of the object distribution network is todistribute object updates to all connected nodes in a way that preservesthe partial order of all updates and achieves eventual consistencybetween all nodes, including support for implicit values, automaticconflict resolution, and derived objects.

The initial purpose of the object distribution network is to provide asubstrate for implementation of other CD services (such as configurationand control services), but instances of the same service couldpotentially be used as delivery services for subscriber applications.

Cohorts and Namespaces

The structure of an object services network is defined by the set ofcohorts and namespaces involved in the network. A cohort is a collectionof nodes representing a connected graph, where there is a direct orindirect communication path from each node in the cohort to each othernode in the cohort involving only nodes in that cohort. In addition,each node in the cohort knows the identity of each other cohort node inthat cohort for the purpose of interpreting vector-clock-based versions.Nodes may participate in multiple cohorts.

A namespace is a distributed mapping from object identifiers toversioned values. Each node is aware of some set of namespaces and mayhave different rights to access objects in each namespace. Each objectexists in exactly one namespace and is addressable with an identifierthat uniquely identifies the object in that namespace. Other distinctkeys that uniquely identify the object are also possible (i.e., theremay be more than one way to name the same object in one namespace).

The cohort and namespace assignments of each node are defined by thenode's configuration, which may change dynamically. The set of cohortassignments at any given time implies a cohort graph, where one cohortmay be connected to another via the set of nodes common to both cohorts.

Causal Buffering

To avoid having vector clock sizes grow with the total number of objectservice nodes in the network, vector clocks may be translated as objectupdates across cohort boundaries using a technique called causalbuffering. In causal buffering, all of the updates originating fromnodes in a different cohort look as if they were made either by one ofthe nodes in the local cohort or by a one of a set of nodes that isproportional in size to the number of neighboring cohorts, not the totalsize of the network. Nodes on cohort boundaries translate updates in away that hides the node identifiers of nodes in remote cohorts,improving scalability. This also imposes some constraints on theinterconnection topology of cohorts, to prevent the same update fromarriving in one cohort from two different directions under two differentaliases that might not be properly orderable.

History and Incremental Delivery

The system may provide a built-in facility for object version history,maintaining some amount of history from the current (possiblyconflicting) version frontier to some older version, and using this tosupport incremental delivery when requested for objects that support itand when there is adequate history, otherwise defaulting to absolutedelivery.

Automatic Conflict Resolution

The system may provide a built in facility for defining conflictresolution scripts based on object type. Such a facility would be used,e.g., for control and invalidation manifests (discussed below).

Derived Objects

The system may provide a built in facility for configurable generationof new versions of objects based on the values of dependency object(s),with support for derivation peering across a set of object servicepeers. FIG. 28 shows an example of derived objects.

Trusted and Untrusted Values

The system may use knowledge about compromised nodes (where a node isbelieved to have been compromised from times T1 to T2) to find allobject versions that are causally affected by values that originated inthe compromised interval.

Compute Distribution Introduction to Compute Distribution

The compute distribution service is a network of configurableapplication containers that define computations in response to requests(usually over HTTP). As with other services, request collections definemappings from actual requests to underlying behaviors. Each behaviorinvolves the execution of some program or set of programs based oninputs derived from the request (including the environment derived fromthe request collection lattice as well as other attributes the scriptsmay themselves extract from the request). The program implied by thebehavior is executed in a container according to some invocation style(which determines the invocation API and callback APIs, where the APIsmay dictate either a buffered or streamed processing style, forexample). In preferred implementations the programs themselves areassumed to be web resources located somewhere on the network.

Invocation Protocols

The invocation protocol for a computation defines the way in which agiven request to the computation service corresponds to calls tounderlying entry points in a configured computation. Rather than simplyinvoke a program in response to a request and expect the program todetermine what it really needs to re-compute, invocation protocols maybe selected that divide up the process into a number of stages, not allof which need to be run on each request. Each invocation protocol shouldimplicitly deal with changes to the program itself, knowing enough torerun the whole process if the program ever changes.

For example, an invocation protocol for a GET request might partitionthe computation involved in a request into the following that can beinvoked separately when needed:

-   -   1. Computation of the set of input names based on the request        (URL, query string, headers, etc.).    -   2. Retrieval of the set of input resource values based on the        input resource names (from wherever they are supposed to come        from, which could be a cache or another compute service).    -   3. Computation of a new output resource based on the new states        of input resources.

Each invocation protocol implies a set of entry points into the programthat can be executed to perform each step. At each level there may beexpirations or invalidations configured to determine whether or not theprevious value for something is reusable, allowing re-computations to beavoided unless absolutely necessary.

It should be appreciated that other protocols are conceivable and may benecessary, especially in cases where the computation of the outputresource is best represented as a stream computation. Such otherprotocols are contemplated herein.

Buffered Vs. Stream Computations

In some cases computations may be configured to use a buffered vs.streamed generator/yield approach.

Engine Isolation

In some cases the system may provide facilities for controlling thedegree of isolation between the execution of computations assigned todifferent subscribers.

Localization

It should be appreciated that, in some cases it may be useful forcomputations to return different results depending on the location ofthe compute service and/or the location of the client invoking thecompute service. This can be achieved in various ways, such as vialocalization of the definition of the computation based on locality ordirect use of location parameters computed by local collectors or othercompute services in an otherwise location-invariant computation.

Control Distribution and Invalidation Introduction to ControlDistribution and Invalidation

This section describes how control information produced by controlservices is consumed by the services being controlled. Controlinformation is transported via control manifests that are evaluated bycontrolled services to produce their control trees. Each serviceinstance constructs a single logical control tree from a root controlmanifest, and this control tree either directly includes or indirectlyreferences all control information needed by the controlled service.Periodic re-evaluation of the control tree results in a continualabsorption of new information from the rest of the network.

This section discusses two related mechanisms used for the flow ofinformation across the system. For control resources that all servicesmust consume, control distribution is the mechanism by which controlmanifests are transmitted from originating control service to consumingservice. For other content or resources that flow through the cachingnetwork or through other services that cache information on behalf offuture requests from other consumers, invalidation is a mechanism thatmay be used to manage the flow. Control distribution is also the meansthrough which invalidation manifests are themselves distributed,providing the basic signaling mechanism(s) needed to implementinvalidation.

As used herein, a “control resource” refers to a representation of acontrolling configuration of a service virtual machine (described belowin the section on request processing) that is directly usable by arunning service instance.

In general, any service, not just services specifically providingcaching services, may, in effect, be caching information for laterdelivery to other clients, and invalidation may be a mechanism useful tomanage updates to this information. Such services may be able to arrangeto subscribe to invalidation manifests that govern those resources,provided there is some other service in the network that generatesinvalidation commands (to the configuration network) when needed, andthe nature of the origin of those resources is such that theinvalidation mechanism can handle it. For all other control information(including invalidation manifests themselves), subscribing to controlmanifests delivered via the basic control notification mechanism andpulling resources when necessary is preferable.

Implications of Distributed Configuration and Control

The design of preferred embodiments of the system for configuration andcontrol represents a conscious choice to sacrifice consistency in orderto optimize availability and tolerate network partitions. This meansthere are no global transactions, and concurrent updates to the “same”object in two different locations are possible. This in turn results inunavoidable conflicts that the system must detect and resolve, in mostcases automatically. Subject to certain assumptions on the maximumnumber of concurrent component failures, the overall system can and willguarantee, however, that updates are never lost once they have enteredthe system, and that the evolving state of the system will respect thepartial causal ordering of distributed events (which defines whichupdates are conflicts and which are not). Configuration objects andcontrol resources are examples of distributed objects with distributedstate subject to these very guarantees (or lack thereof).

Each service must consume control resources specifying its localconfiguration. A distributed sub-network of configuration and controlservices is responsible for managing updates to original configurationobjects and transforming those objects and other data into controlresources. Control services are, in effect, origin servers providingcontrol resources to the rest of the CDN.

A controlled service may get its control resources directly from acontrol service origin or from an intermediate delivery agent, such as acache. Which source it uses at any given time will be determined by thecontrolled service's current configuration (which is based on its pastconsumption of earlier control resources and may change dynamically).Control resources flowing through a caching network may be subject toinvalidation, like all other resources that might flow through a cachingnetwork, but control resources are also the means through whichinstructions about invalidation are communicated to the caching network.

Control Notification Vs. Invalidation

The basic function of the control services network is to providereadable control resources that tell services what their configurationis. It is assumed herein that all services consume their configurationby reading a single root resource intended for them (the binding towhich was established by the consumer's initial configuration andidentity). The root resource represents a tree of control informationcontaining data or metadata sufficient to lead the service to all othercontrol resources it might need. The transfer of this information fromcontrol service to controlled service is the basic function of controlnotification.

Given that services are identified and registered with the controlnetwork in advance, either the controlling service or the controlledservice could initiate the transfer of a new root resource. For example,the method may be one where the client initiates a request to a controlservice on a periodic basis, where the period is established (andchanges dynamically) based on the expiration time of the root resource,or on a separate configuration period that is defined somewhere in thecontrol resource tree.

As each service reads and consumes the tree of control resources, itinterprets the control tree as a set of updates on its internal state inorder to change how it should behave in the future. How this is done,what the control tree looks like, and what internal state is affectedmay be service specific, though all services must implement control treeevaluation to some degree as described in general terms below. Theinternal control state representation of the consumed control resourceis referred to herein as the working control copy of that resource,though it is not necessarily a contiguous copy of the bytes of thecontrol resource but refers to the effect of “loading” the controlresource and thereby modifying the behavior of the service. A service'scontrol tree is the working control copy of its root control manifestcombined with all other control information it needs.

Caches are particular examples of content delivery services that storeand forward essentially literal copies of resources from origins (orintermediate caches) to clients (which could also be other caches, othercontent delivery services, or external clients). Cache-invalidation isthe marking of such cached literal copies stored locally at one cachefor the purpose of affecting subsequent requests for that literal copyby other caches or clients. It does not affect the cache's internalcontrol state unless the cache is also a client of (i.e., controlled by)the very same resource. In fact, a cache may have none, either, or bothof the two different images of a given control resource stored in itslocal state, the working control copy and/or the cached literal copy.

Thus, the basic control notification mechanism determines the flow ofupdates through control copies, whereas cache-invalidation and otherpolicies defined by the HTTP protocol determine the flow of updatesthrough cached literal copies. The information to implement the latteris tunneled over the mechanism providing the former, using specialcontrol resources called invalidation manifests that are embeddeddirectly or indirectly in the tree of control information.

Those of ordinary skill in the art will realize and understand, uponreading this description, that the distinction between basic controlnotification and cache invalidation is a subtle one, but the mechanismsin effect here are distinct, non-redundant, and dependent—invalidationdepends on notification to be able to exist. The control notificationmechanism is needed at least for the root of the control tree and may beused for additional levels of information for services that are notcaches, and caches necessarily rely on the more basic mechanism for thecommunication of invalidation commands that represent a subtree of theoverall control tree. In addition, control distribution typicallyinvolves eager consumption (refresh occurs on notification) of changedresources for a service's own behalf, whereas invalidation involves lazyconsumption (resources are just marked for later refresh) on behalf ofother clients.

Furthermore, neither caches nor any other controlled service shouldassume that the delivery mechanism for its control resources involvescaches or invalidation. The tree of control information provided bynotification ultimately identifies a set of resources in the mostgeneral sense, resources that must be consumed by the controlledservice, along with a protocol for consuming them. The caches that mightbe involved in delivery of those resources from their origin to theclient are determined based on which caches bind the property containingthe resource and on what the results of rendezvous are for theparticular client. A cache, for example, should not assume that acontrol resource it is supposed to consume will be part of a propertythat it binds (i.e., supports requests for), so consuming it via fillsthrough its own cache may not be appropriate. Granted, nothing preventsa cache service from using its local cache to fill/store resources thatit needs but it is not bound to serve to other clients, but this meansthat the control service will not know anything about the existence ofsuch resources (at least as far as invalidation is concerned), becausethey are not contained in any bound property of which the controlnetwork is aware.

Control Trees and Manifests

Both control trees and control manifests can be considered ashierarchical dictionaries, tables mapping symbolic names (slots) toinformation about names, where the names have some predetermined meaningto the consuming service. The information associated with a slot in thedictionary could itself be another dictionary, or something simpler(like a number).

An initial configuration of a service specifies a root dictionary (theroot control manifest) with a small number of items, and each itemprovides information about the configuration of the service or specifiesa way to get it. The consumption of this initial resource thus leadsrecursively to the consumption of other resources, ultimately ending therecursion with a set of service-specific subtrees or leaf resources thathave purely local interpretations and no unresolved references. At eachlevel, the client requests the referenced information indicated only ifthe information is applicable to the service and has not already beenconsumed. The net effect of this absorption process is to update theservice's working control copy of all the control resources that governits behavior. This is how control manifests are transformed into thecontrol tree.

Although the terms “control tree” and “control manifest” are sometimesused interchangeably, a control manifest actually refers to an externalserialization of part of one control tree, whereas the control tree fora service instance refers to its internal hierarchical representation ofone or more control manifests. Consider the following concrete exampleof a root control manifest written in one possible language (describedlater):

{  ″agent″: 99,  ″control″: ″C0″,  ″@agent-config″: {  ″%host″:″%(control)s″,  ″get″: [   { ″%resource″:″/agent/%(agent)s″ }  ]  } }

This is simply a hierarchical collection of name/value settings. Certainnodes in a control manifest (like the node labeled @agent-config above)will be interpreted as symbolic references to other resources whoseidentities and values are resolved and merged into the control treedynamically. The full control tree used by a controlled service is theresult of constructing an initial control tree representation T₀ fromits top-level manifest M₀ and continuously (periodically) re-evaluatingT_(i), recursively expanding references to referenced manifests M₀^((i)), . . . , M_(m) _((i)) ^((i)) as they become known and/or change:

$\overset{M_{0}}{\underset{init}{\rightarrow}}{T_{0}\overset{M_{0}^{\prime}\mspace{14mu} \ldots \mspace{14mu} M_{m^{\prime}}^{\prime}}{\underset{eval}{\rightarrow}}{T_{1}\overset{M_{0}^{''}\mspace{14mu} \ldots \mspace{14mu} M_{m^{''}}^{''}}{\underset{eval}{\rightarrow}}{{T_{2}\mspace{14mu} \ldots}\mspace{14mu} \overset{M_{0}^{(k)}\mspace{14mu} \ldots \mspace{14mu} M_{m^{(k)}}^{(k)}}{\underset{eval}{\rightarrow}}{T_{k}\mspace{14mu} \ldots}}}}$

This process produces a new value of the control tree as a function ofthe previous control tree and the state of the network, and it enablesthe service instance to continuously absorb new information from thenetwork as it becomes available. In general, resources incorporated intoa control tree evaluation round need not be limited to control manifestsoriginating from control services, but may also include other resources(e.g., from collectors) that are meaningful to the service.

A control tree is defined recursively as follows:

-   -   Leaf Rule: If X is a number, string, or otherwise opaque object        (an un-interpreted, internal representation of some control        resource that is not a control manifest), then X is a control        tree.    -   List Rule: If X=[X₀, X₁, . . . , X_(k)], where each Xi is a        control tree, then X is a control tree.    -   Table Rule: If X={N₀:X₀, N₁:X₁, . . . , N_(k):X_(k)}, where each        name N_(i) defines a slot in the table and each X is the value        of slot N_(i) for some control tree X. Also assume there is        metadata meta(N_(i)) about the value X (though this was not        shown in the example above).

Only well-formed control trees will be considered here, and additionalwell-formedness constraints will be defined as needed. The most basicconstraint for a useful control tree is to have a non-trivial rootconsisting of a table. We may also distinguish certain kinds of slotnaming conventions and slot value patterns, as well as define differentevaluation rules in order to implement pattern substitution anddereferencing of symbolic references. The metadata of interest containedin meta(N_(i)) will be related to the expiration or version of the valueX_(i), or the identity or name of the object from which that value wasretrieved.

Control Slots and Evaluation Rules

In order for control trees to be useful, it must be possible to computea new control tree from an old one. For that evaluation rules may bedefined based on the type of each part of the tree, allowing differentstructures to be interpreted differently. Slot evaluation is where mostof the interesting work is done.

Though it is conceivable to allow different service types to definedifferent evaluation rules, for the purpose of explaining the evaluationprocess concretely a particular style of slot evaluation will beassumed. In this example three slot types are assumed:

Reference slots: A slot with a name beginning with a single “@” is areference slot. In an embodiment, its value is a reference instructiontable specifying resource retrieval instructions such as protocol, host,and resource path information. These instructions will be used to expand(dereference) the reference and include the contents of the resource inthe tree at that point.

Escaped reference slots: A slot with a name beginning with “@@” is anescaped reference slot. Its value should also be a reference instruction(but its dereferencing will be deferred). This is intended for the casewhere the evaluation of a reference wishes to return a new value of thereference that may be used to retrieve it on a subsequent evaluationround.

Pattern slots: A slot with a name beginning with “%” is a pattern slot.In an embodiment, its value is a string with embedded variablereferences (where each variable reference has the form % (name)s, wherename must refer to a plain sibling or parent slot).

Plain slots: All other slots are plain slots.

Evaluation will be defined relative to an environment (e.g., a table),where the initial environment for a control tree evaluation is empty,and as we descend into a table the set of slot values for that tableaugments the environment for all slots in that table, and so on,recursively. The notation T₁⊕T₂ is used to represent the table thatresults from applying the slot definitions of T₂ to override or extendthe slot definitions in T₁. Also assume a special slot assignment thatcan be used to delete a single slot, {S:delete}, and another specialslot assignment that can be used to delete all slots, {*:delete},allowing T₂ to represent either an absolute or incremental update to T₁.As a convenience a function mktable(s, X) is defined to return X if X isalready a table, or {s:X} if X is not a table.

Rules for evaluation eval(E, X) of control tree T with environment E maythen be defined in two stages:

eval(E,X)=eval₂(eval₁(E,X))

Most of the work is done in the first stage, where eval₁ expandsreferences that need to be (re)expanded and interpolates patterns,followed by the use of eval₂ in stage 2 to translate escaped referencesinto references.

The rules for eval₁(E, X) are:

-   -   A leaf node X evaluates to itself    -   A list node X=[X₀, . . . , X_(k)] evaluates to

[eval₁(E,X ₀), . . . eval₁(E,X _(k))].

-   -   A table node X={S₀:X₀, . . . , S_(k):X_(k)} evaluates to

X⊕Z ₀ ⊕ . . . ⊕Z _(k), where Z _(i)=evalslot₁(E⊕X,S _(i) ,X ₁).

The evalslot₁ function provides the slot-type dependent evaluation.Assuming X is well formed based on the requirements of the type of S,the result of evalslot₁(E, S, X) is defined as follows:

-   -   If S=@@s is an escaped reference slot, the result is        mktable(@@s, X) (no change).    -   If S=@s is a reference slot, the result is mktable(s, CGET(I)),        a table created from the conditional GET of the resource implied        by the reference instructions I, where I=eval₁(E, X). This is        where the metadata associated with the current value of s is        used, compared to the metadata contained in the instruction I,        which could indicate that a newer version of the same object, or        a different object should be retrieved for the value of slot s.        Note that the result of this evaluation could return not just a        new value for s but also a new value for other slots (such as        @@s for the purpose of changing the reference that will be used        on the next evaluation round).    -   If S=% s is a pattern slot, the result is mktable(s, subst(E,        X)), where subst(E, X) is the string resulting from substituting        the variables referenced in the pattern X with their values        taken from the environment E. The effect of mktable here is to        assign the interpolated string as the value of the slot s, not %        s.    -   If S=s is a plain slot, the result is mktable(s, eval₁(E, X)).        The value of the slot just gets re-evaluated and assigned back        to itself.

Finally, to complete the evaluation rules eval₂(X) is defined in orderto replace all escaped references with references. The rules foreval₂(X) are:

-   -   A leaf node X evaluates to itself    -   A list node X=[X₀, . . . X_(k)] evaluates to

[eval₂(X ₀), . . . eval₂(X _(k))].

-   -   A table node X={S₀:X₀, S_(k):X_(k)} evaluates to

X⊕Z ₀ ⊕ . . . ⊕Z _(k), where Z _(i)=evalslot₂(S _(i) ,X _(i)).

The rules for evalslot₂(S, X) are:

-   -   If S=@@s is an escaped reference slot, the result is

{@s:X,@@s:delete}.

-   -   Otherwise, the result is {S:X}.

Tracking Manifests

The reason why control manifests intended for a given service mightcontain information not applicable to the service is to allow thecontrol network to optimize the delivery of information to a largepopulation of services, where cacheability will depend on thespecificity and update frequency of any given resource. The optimaldelivery package may be a manifest that contains more than a givenservice needs but less than what all services need. The issue ofcacheability also affects the path through which clients will be told torequest resources—sometimes it makes sense to go through the cachingnetwork, sometimes it does not.

Invalidation Manifests

Invalidation manifests are examples of control resources that may bereferenced in control manifests. They are the means through which cachesor other services making use of the invalidation mechanism learn what toinvalidate. A cache's control tree will include direct or indirectreferences to at least all invalidation manifests for properties thatare currently bound to the cache (maybe more). Services that are notusing invalidation will not have invalidation manifests in their controltree (or if they do, they will ignore them as not applicable).

Invalidation Introduction

Invalidation is a mechanism through which information stored in aservice (information that is used to derive responses to futurerequests) is marked as no longer directly usable for responsederivation, thus indicating that some form of state update or alternatederivation path must be used to derive a response to a future request.Services making use of invalidation consume invalidation manifestsdelivered via the control distribution mechanism and locally execute thecommands contained in the manifest.

A caching service is the typical example of a service that makes use ofinvalidation. A cache stores literal copies of resources and responds tofuture requests for the resource using the stored literal copy as longas the copy is not stale. Staleness in this case could be based on anage-based expiration of the original copy that was stored, or based onwhether or not the copy has explicitly been invalidated since the copywas stored. When an invalidation command is received with the target ofthe command already in cache, it suffices to mark the cached copy toimplement the command. When the resource is not in cache, or when thecommand refers to a group of many resources, additional steps must betaken to ensure that a copy retrieved later from some other cachesatisfies the constraints of the last applicable invalidation command.

This section (below) defines embodiments of the invalidation mechanismwith a focus on its use in cache invalidation. It should be appreciated,however, that caches are not the only service type that could make useof the invalidation mechanism, and stored literal copies in caches arenot the only kinds of responses that may be affected. Those of skill inthe art will realize and understand, upon reading this description, thatif a service instance has stored state that affects the response to afuture request, whether that state corresponds to a literal copy of theresponse itself or some other data from which the response will bederived on demand, and provided that validity is expressible in the formof minimum origin version constraints, then invalidation may be used.

Minimum Origin Version Invalidation

Invalidation manifests implement an approach to invalidation based onorigin versions. When content is invalidated via an invalidation commandto a configuration service, a minimum origin version for thatinvalidated content is incremented. Minimum origin version invalidationassumes each origin is a single resource namespace and non-distributed,and all invalidation commands are relative to some origin thresholdevent at a single origin location. This approach allows invalidation tobe defined as the setting of a minimum origin version, where each cachein the system estimates the minimum origin version as content entersfrom origins.

To see how this works, let each origin have a minimum origin version movand a latest origin version by in effect at any given time, wheremov<lov. The minimum origin version changes as a result of invalidationcommands. It should be appreciated that it is also possible to have perresource-group and per resource movs, to enable finer grainedinvalidations. The lov is an origin specific timestamp that needs tochange only when successive origin states need to be distinguished, butit can change more often. Each node in the system that receives cachefills from the origin or invalidation commands from outside the systemmust estimate the corresponding lov. Each peer fill request,invalidation command, or origin fill generates a new lov′ for thecorresponding resource scope based on the previous lov and otherinformation. In particular, on an origin fill use:

lov′=max(lov,clock)

where clock is the local clock, and on peer fill requests andinvalidation commands set:

lov′=max(lov,mov)

where mov is the constraint from the peer fill or invalidation command.

A cache learns initial mov and lov values from its property specificconfiguration, and learns new values from the invalidation data streamthat each cache consumes to detect invalidations.

When a cache requests content directly from an origin server, theorigin's updated lov is assigned as the resource origin version rov whenthe resource is stored in cache and is communicated via an HTTP headerwhenever the resource is served to another cache. The rov remains as theactual origin version of that copy of the resource wherever it goesuntil it is revalidated or refreshed. If a cache requests content fromanother cache, the client cache uses whatever rov the server provides asthe rov it stores in cache.

A cache learns the minimum and latest origin versions (per property andoptionally per resource or other group level) from its invalidation datastream for the property. To cause an origin level invalidation, a newminimum origin version is established for the entire property. To causea resource level invalidation, a minimum origin version is establishedat the level of individual resources or groups of resources in thecache. All resource specific movs may be overridden by a new group ororigin level mov, as described next.

A cached resource R is considered stale if the rov of the cached copy isless than the largest of the version minima that govern it, or, in thecase of resource-level and origin-level constraints:

stale(R)≡_(def)rov(R)<max(mov(R),mov(Origin(R)))

In general, the CDN may have more than just resource level and originlevel invalidations, and have invalidations in terms of arbitrary groupsof resources. Each of multiple resource groups

(R)=G₀, . . . , G_(k) could provide a minimum version constraint on eachresource in the group, where G0 is the resource itself, G_(k) is theorigin, and G₁, . . . , G_(k−1) are other groups or expressions inbetween that contain R. This results in the generalized form:

stale(R)≡_(def)rov(R)<max{mov(g)∥g∈

(R)}

Ignoring expressions for the moment, and considering only configuredresource groups, the cache would simply have to maintain a lattice ofgroup labels per origin that is part of the corresponding property'sconfiguration, and each resource would be directly associated with oneor more groups as defined (which could be computed dynamically based onanything about the request or response, not just the URL). The set ofgroups

(R) would then be the transitive closure of the parent group relation,and the staleness rule above would apply to that set of groups.

Ground Vs. Group, Cached Vs. Uncached

An invalidation command specifies an mov and some resource descriptorthat identifies a single resource or group of resources that may or maynot currently be in cache. The handling of the invalidation command mayneed to be different depending on whether it refers to a single cachedresource or a group, and whether or not the identified resources arecurrently in cache.

It is assumed here that it is possible to syntactically distinguishinvalidation commands based on whether they specify individual resourcesor groups of resources (that may consist of zero or more resources). Aground resource specifier identifies exactly one resource by name,whereas a group resource specifier identifies a group of resources bysome set of constraints (on the name or other properties of theresource). Thus the set of resources identified by a group is notnecessarily known in advance, but for any specified resource (or requestfor a resource) it is known whether it is a member of the group (i.e.,what is known is a method for testing whether or not any given resourceis a member of the group).

Group invalidations may need to be handled differently than groundinvalidations because they may affect a large number of resources andthe information stored in the cache may be insufficient to determinegroup membership. In such cases it may be preferable to evaluate groupmembership on demand as opposed to walking the caching and markingentries (that may never be requested again) at invalidation time.Invalidations for uncached resources are special because, by definition,there is no cache entry available to be marked. A ground invalidationapplies to a single resource that is either in cache or not, but a groupinvalidation may apply to some resources in cache and other resourcesnot in cache.

Safety and Accuracy, Invalidation Vs. Implication

When an invalidation command is processed by a cache, the effect of theinvalidation command must be captured in a permanent way, such that allsubsequent behavior of the cache is consistent with the constraintimposed by the invalidation command. This applies whether the command isground or group, and whether the resources identified are in cache ornot. It also applies regardless of how many times the identifiedresources enter and leave the cache after the identifying invalidationcommand was processed.

Assuming safety is a requirement (within the physically achievablelimitations), and assuming there is a continuously varying stream ofinvalidation commands from multiple command sources identifying acontinuously growing population of resources, there is a tradeoff to bemade between avoiding unnecessary refreshes (accuracy) and storing anunbounded amount of information (cost). In other words, the system mightstore less information but as a result need to refresh more often inorder to remain safe.

In particular, one possible side effect of handling invalidations foruncached resources is that it may be desirable to expand the scope ofthe invalidation in order to ensure the effect persists indefinitelywithout expecting storage to grow without bound or to grow in proportionto the size of the invalidation distribution network. As used herein,the correct processing of an invalidation command I may invalidate someresources as well as implicate a possibly larger set of resources,including but not limited to the invalidated resources. The (strictly)invalidated resources Inv(I) are those resources that were intended tobe invalidated by the semantics of the command, and the implicatedresources Imp(I) may additionally include resources that were notintended to be invalidated but were refreshed before their time due tothe limited accuracy of the invalidation mechanism.

Thus, the safety requirement for an invalidation mechanism can berestated as the following assertion for any invalidation command I:

Inv(I)⊂Imp(I)

and the accuracy goal is:

Inv(I)≈Imp(I)

Ideally, the implicated set is at least as big as the invalidated set,but no bigger.

the Effective mov

The effective mov of a requested resource in cache is the maximum mov ofall mov constraints that apply to, or implicate the resource inquestion, including but not limited to the resource-level mov. Dependingon the invalidation mechanisms implemented, this could be somecombination of mov values tracked in multiple places (e.g., for resourcegroups that contain the resource in question). The resource in cache isvalid if rov≧mov_(effective). If not, an origin or peer fill must bedone (depending on policy), and if a peer fill is done, the movconstraint is based on the mov_(effective).

Methods for Invalidation of Uncached Resources

There are a number of possible ways to handle the invalidation ofuncached resources. The approaches discussed below are all safemechanisms that differ in accuracy and storage requirements. Toillustrate the differences in accuracy that result from differentimplementation strategies consider two general models of implication areconsidered, with and without command tracking. Certain connections tothe implementation of group commands are deferred to a full discussionof group (expression) based invalidation.

Consider the diagram in FIG. 30-A showing the following sequence ofevents:

-   -   1. Cache A receives a ground invalidation command implicating a        resource RX that is not in A's cache. Before this command was        received there was another resource RY≠RX that was in cache and        considered fresh at cache A.    -   2. Some client requests resource RY from cache A. Depending on        how A processed the invalidation command, it may have implicated        resources other than RX that it does have in cache, such as RY.        Assume RY was implicated, and is therefore (conservatively)        considered stale by cache A.    -   3. Cache A then requests RY from cache B, communicating some        information about its expectations to B (which were derived from        I(RX)). Cache B uses these expectations to decide if its copy of        RY (previously considered fresh in B) can be returned to cache        A, or whether it needs to refresh. In this case, it also        considers RY implicated by the constraints in the peering        request, and must therefore be conservative and consider it        stale.    -   4. Cache B requests a fresh copy of RY (RY′) (e.g., from the        origin).    -   5. The origin returns RY′.    -   6. Cache B returns RY′ to cache A.    -   7. Cache A returns RY′ to the client.

In this example, fresh copies of RY at both caches A and B were passedover and refreshed due to RY being implicated by an invalidationdirected at the uncached resource RX.

Now consider a slightly different scenario where invalidations aretracked via command tracking at some predetermined level of grouping(e.g., per property). In this case, assume RY is in cache A and B priorto the invalidation command being received at A, and assume theinvalidation command affects RX but not RY (and both are in the sameproperty group). With reference to FIG. 30-B:

-   -   1. Cache A receives a ground invalidation command I implicating        only a resource RX (in this case the system does not care        whether RX is in cache or not). Before this command was received        it was assumed that resource RY was not in cache at A, where        RY≠RX. Since command tracking is being used, RY is not        implicated by I(RX).    -   2. Some client requests resource RY from cache A.    -   3. RY is not in cache A, so A requests it from cache B,        specifying the constraints for use in invalidation command        tracking.    -   4. Cache B notices that, since it has not processed command I,        its otherwise fresh copy of RY must conservatively be assumed        stale. Cache B therefore requests a fresh copy of RY (e.g., from        the origin).    -   5. The origin returns RY′.    -   6. Cache B returns RY′ to cache A.    -   7. Cache A returns RY′ to the client.

In this example, a fresh copy of RY at cache B was passed over andrefreshed due to RY being included in the same invalidation trackinggroup as RX, and since cache B was behind cache A for that group.

Those of skill in the art will realize and understand, upon reading thisdescription, that variations on either or both of these two scenariosmay occur in just about any method, and that accuracy (avoidingunnecessary conservative refreshes) may be increased by adding storage.The following seven methods that make different storage/accuracytradeoffs are discussed here:

-   -   1. Cache entry method (always store a cache entry);    -   2. Treat ground invalidation of an uncached resource as a group        command;    -   3. Maintain an auxiliary data structure indexed by the hash of a        resource;    -   4. Command tracking at the property or resource level;    -   5. MOV-based command tracking (property level);    -   6. MOV-based command tracking with synchronization (property        level);    -   7. MOV-based command tracking with synchronization (approximate        resource level).

Cache Entry Method

The most accurate and least space efficient way is to always generate acache entry (empty if necessary) to hold the mov constraint associatedwith the invalidated resource. This stub resource can be deleted if theproperty-specific mov exceeds the resource-level mov. When cachedobjects are evicted from cache a stub for them must be retained if therewas an invalidation implicating it since the last property-level movupdate. The set of resource entries in this method grows with the totalnumber of unique resources invalidated since the last property-level movupdate, so additional measures may be needed to deal with this effect,and these measures could implicate additional resources.

Treat Ground Uncached as a Group

Similar to the cache entry method, the ground command may also betreated as if it referred to a group that identifies exactly oneresource, and process it with all other group commands (as describedlater). This has storage and accuracy properties similar to just storingan empty cache entry, but provides a different way to age the effect ofthe command out of the cache, which in turn implicates additionalresources in a different way.

UCMOV Method

Another way is to maintain an auxiliary data structure, e.g., an arraycalled UCMOV (uncached mov), capturing a conservative mov value to usefor all uncached resources. The value of UCMOV[i] is maintained suchthat all resources hashing to location i have had an invalidationconstraint implicating them that is less than or equal to UCMOV[i], andthen UCMOV[i] is used as a group mov that applies to all uncachedresources hashing to location i.

This satisfies the effect of invalidation commands, but implicatesunintended resources. Whenever an invalidation command I is processedfor a ground resource R (not an expression) and the resource is notcached, update the conservative mov for one entry in this data structureas follows:

UCMOV[hash(R)]=max{mov(I(R)),UCMOV[hash(R)]}

Then, when a resource is requested that is not in cache, the movconstraint used for that resource is UCMOV[hash(R)], and we areguaranteed that:

UCMOV[hash(R)≧I(mov(R))

In the extreme case where UCMOV has one entry, this is equivalent tousing the maximum mov seen in any invalidation of an uncached resourcefor the mov constraint used for all uncached resources. This allows usto trade off storage against accuracy (a larger UCMOV array implicatesfewer additional resources with each update since fewer resources hashto the same location, so a larger UCMOV increases accuracy).

When resources are deleted from cache, the state of their invalidationconstraints must be rolled back into UCMOV as follows:

UCMOV[hash(R)]=max{mov(R),UCMOV[hash(R)]}

The use of this UCMOV data structure is equivalent to providing anadditional group command I(hash(R)) with each ground invalidation I(R),but handles the application of these special group commands differentlyfrom other group commands. There is no need with a UCMOV to collapsecommands over time, the storage overhead is fixed.

Command Tracking

The known and seen tokens of coherent peering provide a means to dealwith invalidation of uncached resources. This is a concrete form ofcommand tracking, and could be used to eliminate the problem discussedearlier in FIG. 30-B if it were applied at the resource level. Whenapplied at a higher group level it will necessarily have the effect, asillustrated in FIG. 30-B of conservatively implicating fresh resourceswhen the server is behind the client in invalidation command processing.However, command tracking requires maintenance of invalidation-sourcebased vector clocks for all invalidation sources, something that isdifficult to scale, especially when applied at the resource level.

MOV-Based Command Tracking (Property Level)

It is possible to combine command tracking's unique benefits foruncached resources with some additional facts about movs andinvalidation command sources in order to minimize the growth of commandtracking information that needs to be maintained.

Let each cache also maintain an mov per invalidation command source thatit has ever seen, per property. Call this the source level mov, or sov.Assume that, with respect to a given source of invalidation commands (acontrol node), invalidation commands are delivered in order and withnon-decreasing mov constraints.

Each time an invalidation command from a particular source is received,the local sov for that source is changed to the maximum of the last sovand the mov of the invalidation command (per property). If theproperty-level mov ever exceeds the sov for a source for that property,that source's entry can be dropped from consideration until anotherinvalidation command is received from that source.

Whenever a fill is requested from a peer because of an uncachedresource, a set of constraints must be computed based on the local sovvalues, the property level mov, and any applicable group movs, and theseconstraints must be specified in a request header to the peer. Onlythose sov constraints that are both greater than the effective mov ofthe uncached resource need to be communicated. The effective mov shouldalso be provided.

If the server has the resource in cache and has processed all the listedsources through at least the listed sovs, then it can assume the sovs'effects, if any, have been applied to the resource in cache and arereflected by the stored mov. It can then make its freshness decisionbased on the supplied mov constraint for the resource and its owneffective mov for the resource.

This provides the benefits of command tracking for uncached resources ina more scalable way, thus avoiding the problem of FIG. 30-A but stillsuffering from the problem shown in FIG. 30-B.

MOV-Based Command Tracking with Synchronization (Property Level)

The next change may be arrived at by realizing that, for the problemillustrated in FIG. 30-B, the constraints provided in the previousmethod can be used to catch up with invalidations for those sourceswhich are known to have invalidation commands not yet processed. Theinvalidation commands that the receiving cache knows it has notprocessed yet (but the client has) can be requested from theinvalidation command source, using the last sov as the point to startfrom. The catch-up processing is work that would be performed anyway,and performing it proactively allows the system to confirm whethercertain resources are implicated or not by missed commands.

In cases where the source in question is not reachable it may still bedesirable to conservatively assume that its invalidation commandsprocessed by our client affect the resource the client is asking for,and refresh it.

MOV-Based Command Tracking with Synchronization (Approximate ResourceLevel)

Both of the previous solutions do command tracking at the propertylevel. The use of sovs prevents the source list from growing withoutbound, but since sovs are tracked at the property level, caches do notknow which resources are affected by a given command state and thisleads to the need for conservative refreshes as shown in FIG. 30-B. Notethat this is only a problem for resources that are not in cache, becausethere is resource level mov information for entries that are in cache.

To improve the resolution of command tracking for uncached resources,the system may apply a technique similar to the UCMOV data structure.Instead, maintain a UCSOV array that is indexed by hash(R) and storesthe most recent command state that affected any resource with that hash.In this case, the stored command state would be a list of sources andtheir sov values, together with an mov for the overall group mapping toindex hash(R).

Thus, when a cache fills from a peer due to an uncached resource, ituses UCSOV[hash(R)] trimmed by any other mov constraints implicating Ras the constraint it communicates to the peer. This command state is ingeneral older than the most recent command state, so it is in generalmore likely to be achieved by the peer, and less likely to force aconservative refresh. The peer uses its own UCSOV[hash(R)] to determinewhether or not it has processed enough commands to satisfy the requestfrom its cache. If not, it attempts synchronization or simply fills.

Finally, the processing of a ground invalidation command now needs toupdate the value of UCSOV[hash(R)] to be the command state at thatpoint, regardless of whether the resource is cached or not. Groupcommand processing is unchanged, however—it is neither feasible nornecessary for a group command to update UCSOV for all values of hash(R)where R is a resource contained in the group. The effect of groupcommands on the effective mov is handled separately and in addition tosov processing.

Groups and Expressions

A group is a collection of resources defined by intension, i.e., by someset of constraints over the set of possible resources (as opposed to adefinition by extension, which involves an explicit listing ofresources).

The approaches described here use patterns and pattern matching. As iswell known, a pattern language may be used to express patterns.Different pattern languages define different grammars for representingpatterns. Some pattern languages may also express operations andinteractions to be performed when patterns match (or do not match). Somepattern languages use so-called metacharacters. As used herein, a globpattern language is any pattern language where the “*” metacharacter isused to match any sequence of characters, although other metacharactersmay also exist. A glob is a pattern written in a glob pattern language.A *-glob (star glob) pattern language is a glob pattern language withonly the “*” metacharacter and literal characters. A *-glob (star-glob)(or *-glob pattern) is a pattern written in a *-glob pattern language.It should be appreciated that the system is not limited in any way bythe pattern matching algorithms or languages used or described herein.Nor is the system in any way limited by the particular language orprogram used to implement the patterns or pattern matching (or relatedoperations) described herein. In particular, it should be appreciatedthat regular expressions or glob patterns defined on the request URL arejust some of many possible ways to define groups. Those of skill in theart will realize and understand, upon reading this description, thatdifferent and/or other ways of describing groups are contemplatedherein.

As used here, “resource” means a (potentially) cached response to aparticular request, so theoretically any attributes of the request orthe response may be considered to define a group. An actualimplementation of a resource group based invalidation system mightimpose additional constraints on how groups can be defined forefficiency, but such constraints need not be imposed at thearchitectural level.

A group may be defined to be a set of constraints on the values of namedattributes of the resource (where it is assumed to be clear in thenaming of the attributes whether it applies to the request or theresponse). The set of resources that are members of the group is the setof all possible resources (cached or uncached) that satisfy all of theattribute constraints. In general, the constraints may be treated as an“and/or” tree of constraints over attributes. However, for simplicity ofexplanation, the constraint set may be considered as a flat conjunctionof simple constraints on individual attribute names. Although it ispossible for resource origins to declare specific named groupings inadvance, this is not required in order to be able to use group-basedinvalidation. Groups can simply be mentioned as needed as arguments toinvalidation commands.

Thus an invalidation command I(mov,

) can be specified by a mov constraint and a constraint set

. The denotation [[

]] of the constraint set

is the set of all resources that satisfy all of the constraints in

. This leads to the following interpretation:

I(mov,

)=ensure rov(R)≧mov whenever R in [[

]]

where:

-   -   R∈[[        ]] if and only if (∀c in        )(c(R))

Some examples are provided here:

-   -   A command to invalidate everything specifies just an mov        constraint and lists an empty set of additional constraints on        the resources to which it applies (so it applies to all        resources for the property):

{rov≧mov,}

-   -   A command to invalidate a resource with a specific URL:

{rov≧mov,{url=“http://foo.com/index.html”}}

-   -   A command to invalidate all resources that match a glob pattern:

{rov≧mov,{url≈_(glob)“http://foo.com/*.jpg”}}

-   -   A command to invalidate all resources that match a regular        expression:

{rov≧mov,{url≈_(rex)“http://foo.com/[0-9]+.*\.jpg”}}

-   -   A command to invalidate all varied responses on User-Agent where        the agent was a certain browser:

{rov≧mov,{Vary≈_(contains)“User-Agent”,User-Agent≈_(contains)“MSIE 10”}}

Note that the UCMOV data structure described earlier may be replacedwith a group constraint. When a specific resource R is invalidated, thefollowing group constraint may be entered:

{rov≧mov,{hash=hash(R)}}

and then rely on the fact that earlier group constraints with lessermovs on the same hash bucket will be subsumed by this one (or this onewill be ignored, if it is subsumed by another command with a greatermov). As mentioned earlier, however, it still might be useful toseparate the handling of the two kinds of constraints, and preserve theUCMOV array as an optimization. The choice of attribute names and theexpressiveness of the value constraints have performance implications(discussed below).

Safety and Exactness of Group Handling

The safety requirement in this context is that once a cache hasprocessed an invalidation it must respect the invalidation indefinitelyin terms of how it services all resources that are implicated by thecommand. The effect of the command must persist in the cacheindefinitely, regardless of how often implicated resources come and go.

There is a fundamental tradeoff that must be made here betweenimplementing this exactly (i.e., achieving the safety requirement butnever invalidating resources that are not implicated by an invalidationcommand), and implementing it efficiently, because an exactimplementation requires unbounded storage, and an implementation withbounded storage is necessarily inexact. The only possible alternativesare to relax the safety constraint or use a safe but inexact solution.

Relaxing the safety constraint would relieve the cache of respecting theeffect of certain invalidation commands past a certain period of time.This is not unlike the effect that ensuring the safety constraint has onthe effective average time to live of items in the cache (assumingbounded storage).

Assuming again that ensuring safety is a requirement, onlygeneralizations that achieve the safety objective with a bounded amountof storage are considered. The storage bound rules out trivial andunhelpful generalizations where the new group is defined to simply bethe disjunction of the original groups. If the number of groups isunbounded, this kind of generalization also has unbounded size and isnot helpful because the size of a specification with an unbounded numberof groups is itself unbounded, so it is preferable to discard someinformation in order to bound the storage requirements. Discarding thisinformation from the group specification has the effect of expanding theextent of resources impacted by the group, eventually reaching theentire cache (assuming a sufficiently variable and continuous stream ofinvalidation commands), which is what leads to a bound on the averagetime to live of cached resources.

The way to safely but inexactly implement group based invalidation is totransfer the mov constraints of old invalidation commands to beconstraints on larger and larger population of resources that areguaranteed to include the originally implicated resources, therebyensuring safety but invalidating additional resources, but allowing usto forget the old invalidation commands. As shown in FIG. 30-C,inaccuracies due to generalization arise in both the resource extentdimension and the mov dimension.

Efficiency of Group Handling

A simplistic approach to computing the effective mov takes timeproportional to the length of the list of groups that are outstanding,where a groups are outstanding if they have mov constraints that aregreater than the mov constraint of the property as a whole. When theproperty level mov constraint advances, all outstanding groups withlesser movs can be discarded. But the property itself can be thought ofas just another group, a group that anchors and subsumes all othergroups, and whenever an invalidation command relative for one group(property level or otherwise) subsumes another group and has a greatermov, the subsumed group can be deleted from the list. It is notnecessary to always know if one group subsumes another, but it will beuseful to be able to handle certain cases.

A requested resource must be compared with each applicable group (thatdefines a greater mov) to determine which groups match, and the max ofall their movs is taken as input to the effective mov calculation. Tomitigate the effect of this processing on request handling time, acouple of strategies are possible.

First, if the request is for a resource for which there is also a cachedentry with a mov constraint, then only those groups that define largermov constraints need to be consulted, because they are the only groupsthat can change the ultimate effective mov.

Another strategy is to note that the group list needs to be consultedonly if it has changed since the last time this resource was comparedagainst the group list. The cache entry for the resource can store theeffective mov and a purely local sequence number for the group list(such as the lov of the property at the time the group command wasinserted, which is referred to as the group lov, or glov). On asubsequent request with the resource still in cache, the group listneeds to be consulted only if it has changed, only the changed partneeds to be consulted, and only those entries with sufficiently largemovs need to be examined.

Another strategy is to have a mov that applies to all groups (but isseparate from and greater than the property level mov). If the size ofthe group list exceeds a configurable threshold, the size can be reducedby advancing this background mov and deleting all outstanding groupconstraints that are less than that mov. This maintains safety andreduces the size of the list at the cost of some extra refresh fills.

The most general strategy is to be able to collapse two or more oldgroups down into a single group that subsumes the older groups with anmov that it at least as large as any of the older movs, and to applythis strategy as needed to fit the invalidation command list into somelimited space. This turns the oldest part of the invalidation commandlist into a “crumple zone,” an area in which commands may be crumpledtogether if needed to stay within the allocated space. Combining thiswith the UCSOV approach for command tracking results in the approachshown in FIG. 30-D. The next section describes what happens in thecrumple zone in more detail.

Crumple Zones

Using crumple zones, invalidation commands may be inserted into a movordered list (there may also be a separate list ordered by time ofarrival), and once the length of the list passes a certain threshold,the tail of the list is subject to being crumpled. Crumpling takes theoldest entry in the list, chooses an earlier entry in the crumple zoneto crumple it with, and replaces the two commands with one, repeatingthe process as necessary until the length is reduced by someconfigurable amount.

With reference now to FIG. 30-E, in step 1 the command list has plentyof space. By step 2 the area of original groups is full and there arecommands (C0, C1, C2) overflowing into the crumple zone (but nocrumpling has occurred yet). In step 3 the crumple zone hits a thresholdand C0 is crumpled with C3, creating a new command C3′ as shown in step4. In this example, the new crumpled command masks an older commandbecause it just happens to be the same as C2, so in step 5 deletecommand C2. Continue by crumpling the new oldest command C1 with C4 instep 6, creating a command that specifies the group “*” in step 7. Thiscorresponds to the property level group and masks all older commands,and these commands are deleted, resulting in the state shown in step 8.

Crumpling commands requires two steps, a canonicalization step and ageneralization step.

Multi-Attribute Invalidation and Crumpling

The extension of both invalidation commands and crumpling operations tothe multi-attribute case is straightforward. If a single-attributeinvalidation command identifies a resource or group of resources by aconstraint on the value that one particular attribute must satisfy, thena multi-attribute command simply specifies a constraint for each ofseveral attributes. A resource is implicated by a multi-attributecommand if it is implicated by all of its constraints.

Crumpling of a group of multi-attribute commands is then defined astaking a subset of the intersection of attributes mentioned in allcommands, crumpling the single-attribute constraints for the chosenattributes, and taking the maximum of the mov constraints.

Constraint Languages, Canonicalization, and Generalization

For many applications of invalidation, constraints expressed as patternsover strings will be adequate. Other, more general constraint languagesthan string patterns, are however contemplated herein, andcanonicalization and generalization operations may be defined for theelanguages.

For example, the implicit handling of $mov$ constraints above is anexample of a simple constraint language over version numbers, where eachconstraint states that a version must be greater than or equal to someconstant. Canonicalization in this case is trivial, because allconstraints have one form, rov≧M. The generalization of two movconstraints rov>M1 and rov≧M2 is to simply to take the maximum,resulting in rov≧max(M1, M2).

For other numeric attributes, and for other data types in general, otherconstraint languages may be defined with their own canonical forms andgeneralization rules, and the invalidation mechanism can make use ofthem. In the next two sections, however, we focus on the example ofcanonicalization and generalization of constraints based on stringmatching. Those of skill in the art will realize and understand, uponreading this description, that the system is not limited by the specificstring-matching implementations described or by any examples provided.

Canonicalization Via *-Glob Translation

For constraints that are expressions on strings, the initial constraintspecified in an invalidation command might be expressible in variouslanguages, including regular expressions or globs. In order to be ableto process and compare expressions, all string constraints willeventually be converted in the crumple zone into more generalconstraints that are *-globs, where a *-glob is defined to be a globexpression containing only constant characters and any number ofinstances of the “*” metacharacter (each of which matches any number ofany character).

The translation to a *-glob must guarantee that all strings matched bythe initial expression are matched by the translated expression, butthere may be strings matched by the translated expression that are notmatched by the initial expression. The goal of the translation is tocanonicalize the language and produce an expression that has a lengthbounded by some configurable maximum length.

-   -   The translation of some expression e to a canonical *-glob        proceeds as follows:    -   Translate all non-constant regions of the expression e to stars,        combining adjacent stars into a single star (“*”).    -   while length(e)>maximum and the number of stars >1:        -   Replace the first contiguous constant string between two            stars with a single star.    -   Now, either length(e) is less than the maximum (in which case        the process is done), or the length is still too long but just        one star is left.    -   Remove chop(length(e)−maximum, length(x)) characters from the        star-side of the longest string constant x to the right or left        of the star.    -   If length(e)>maximum then remove chop(length(e)−maximum,        length(y)) from the string constant y on the other side of the        star, where:

${{chop}\left( {{need},{have}} \right)} = \left\{ \begin{matrix}{need} & {{{{{if}\mspace{14mu} {have}} - {need}} > {MIN}},} \\{{have} - {MIN}} & {otherwise}\end{matrix} \right.$

This assumes maximum≧1+2×MIN and is designed to take information out ofthe middle of the expression and retain information on the edges, whereMIN is the minimum amount of a constant prefix or suffix that will beretained on the edges of the expression.

Generalization Via *-Glob Alignment

Now, equipped with canonical *-globs in the crumple zone of some maximumlength, periodically need to take two globs and determine theirgeneralization. This can be viewed as a sequence alignment problem andsolved using the usual dynamic programming technique. This requiresO(n²) time and space, where n is the length of an expression, and thatis the reason for the maximum length in the translation described above.If the alignment cost function aligns only characters (including the “*”[star] character) that match exactly, and gaps in the alignment aretranslated to stars, then a generalized expression from the minimum costalignment may be determined. This is done by following the alignmentpath and emitting the character for each exact match and emitting asingle star for each contiguous set of gaps in the alignment, thencollapsing multiple contiguous stars down to one.

As an example, FIG. 30-F shows glob alignment of “a*bc” with “a*c*d”.

To bias the alignment to prefer matching material at the edges overmaterial in the middle, the cost function may be biased such thatmatches take into account the position of the characters in theirrespective expressions relative to the edges.

Invalidation Command Affinity and Protection

The crumpling of commands has the effect that resources not implicatedby any of the original commands may be implicated by the crumpledversion. The extent of this expansion of the implicated resource set maybe more or less severe, depending on the nature of the commandsinvolved. Affinity captures the notion that it is preferable to combinesimilar commands together, and protection deals with the case that somecommands should remain uncombined longer than others.

Affinity provides a static grouping mechanism. Affinity groups constrainhow invalidation commands may be grouped and crumpled, but they do notdirectly define resource groups per se.

Let there be a set of affinity groups defined per property with symbolicnames. One special affinity group is defined for the property as a whole(and has no parent group), and all other affinity groups are definedwith exactly one other parent group. Affinity groups other than theproperty level group are optional.

Now, only commands of the same affinity group may be crumpled together.

The affinity group of an invalidation command could potentially becomputed in some predetermined way from the command itself, but assumehere that it is assigned by the submitter or the mechanism that submitsthe command to the system. The crumpling mechanism is free to furtherrestrain itself by using other information gleaned from invalidationcommands (such as constraint prefixes) in addition to the informationprovided by affinity groups.

Protection provides a means to throttle the crumpling mechanism. Eachinvalidation command can be assigned a protection value, a number in therange [0, 1] that maps to how long the command will remain un-crumpledrelative to some configured time interval for the property. A protectionof 0 is the minimum protection (gets crumpled earliest) and 1 is themaximum (gets crumpled the latest). At some point, assuming safety mustbe ensured with a bound on the invalidation command list, and assuminginvalidation commands keep coming, all stored invalidation commands getcrumpled down to a constraint that implicates all resources, which ineffect moves the property level mov forward and thus affects the averageTTL of all cached resources in the property.

These two factors modulate the behavior of the invalidation system incases where there is room to maneuver, they don't override the need todiscard and crumple invalidation commands when all affinities andprotections have been taken into account and there are still too many.It just represents advice to the system.

Other Methods of Expression Based Invalidation

Expression based invalidation can be handled in several different ways(including methods described above). Either the cache implements anefficient map of cached URLs, or a separate service based on reductionof cache events can maintain an index of cached resources, and it cantranslate invalidation patterns into the list of cached resources percache. This service can be used by the control network in a feedbackloop that takes invalidation manifests containing patterns and localizesthem for cache consumption by expanding the patterns into ground URLs.

Gradual Invalidation

Invalidations can potentially cause abrupt and large changes in filltraffic patterns, with undesirable side effects on clients and origins.Although invalidations just mark content as stale and it is subsequentrequests of stale content that increase fill traffic, if an invalidationis not an emergency it might be preferable to not force the inevitableto happen too fast. Ideally it would be possible instead to request thatthe process take place over some minimum time interval T, such that theinvalidation will complete gradually and no faster than T units of time.

To accomplish this, the definition of staleness is augmented to be astochastic one, where the staleness of a resource is based not only onits version-based staleness but also on how much time has elapsed sincethe invalidation was processed at the cache. The staleness of eachresource may, e.g., be based on a random number relative to a thresholdthat approaches zero as T ticks away. For example:

${{gstale}\left( {R,T,t_{mov},t} \right)} \equiv {{if}\left( {{{random}\left( {0,1} \right)} \geq {\left( {1 - \frac{t - t_{mov}}{T}} \right){then}\mspace{14mu} {stale}\mspace{11mu} (R)\mspace{14mu} {else}\mspace{14mu} {false}}} \right.}$

where t is the current time in the cache, t_(mov) is the time the cachereceived the applicable mov update, and T is the length of the gradualinvalidation period. The value of the condition is more and more likelyto be true as t gets larger, and is certain to be true if t−t_(mov)≧T.

Invalidation Sequencing

It is sometimes desirable to invalidate one or more resources over aperiod of time. In this regard, gradual invalidation has been proposedabove.

It is useful to understand some of the processing that may occur when aresource is invalidated in a CDN. When a particular resource isinvalidated at a particular node (or service endpoint or machine) in theCDN it means that that particular resource is no longer to be consideredvalid and should generally no longer be served by that node until anattempt has been made to verify whether the particular resource is stillup to date. It should be appreciated that asynchronous refreshing andfailures to revalidate may still lead to this resource being served froma cache. Depending on various factors, including, e.g., spacelimitations, policies, etc., an invalidated resource may be deleted froma location and/or it may be marked as invalid. Importantly, subsequentrequests for that resource (i.e., for a resource with the name of thatresource) should cause the node to try to acquire a current version ofthe resource, e.g., from a peer node, a parent node, etc. It ispossible, however, that invalidation information may not yet havereached or been processed at the place in the CDN from which the node istrying to acquire the current version of the resource. Depending on theinvalidation scheme used, a node may acquire an invalid version of theresource from another node because that node has not yet invalidated theresource. For example, a node may try to get a current version of aresource from a peer resource, although the peer resource may not yetitself have received or processed the invalidation information.Furthermore, a node's attempt to obtain a current version of aninvalidated resource may cause excessive and unnecessary processing inthe CDN. It should be appreciated that a motivation for this sequencingapproach is to limit the amount of fill traffic to the origin server(s).Depending on how invalidation coherence is attained, absent this systemthere may be multiple requests for the same resource from the samefill-responsible parent and/or origin server.

The inventors have realized that it may be preferable to sequence orstage invalidation through a CDN, especially in the case of anhierarchical CDN. This staging or sequencing can be used to reduceoverhead on intermediate nodes in the CDN. As should be appreciated,preferably content is first (re)loaded into the tiers closer to theorigin, such that invalidations taking place further out (e.g., closerto the edge) are satisfied from within the CDN (thereby avoiding placingtoo much load on the origin). It should further be appreciated that thisapproach improves the efficiency of the network, increasing thelikelihood that the correct version of a resource will be available at apeer-server when asked. This reduces the amount of duplicate effortexpended, as well as reducing the amount of fill traffic.

Accordingly, in some aspects, invalidation may be sequenced through theCDN by providing invalidation information (e.g., invalidation manifests)to the CDN nodes in an hierarchical order. For example, if the CDN hasor is organized into multiple tiers, then invalidation information maybe provided to the tiers (e.g., one at a time, perhaps overlapping) insome particular order. E.g., the invalidation information may beprovided first to the CDN nodes closest to the origin, moving out to theedge of tiers last. Alternatively, invalidation information may beprovided first to the edge tiers, moving inward towards the origin.

As described above, invalidation may be set to occur gradually, e.g.,within a predetermined time period. Sequenced invalidation may becombined with gradual invalidation, whereby invalidation instructionsmay be sequenced in the CDN and gradually at each node of the CDN.

In an alternate implementation, the gradual invalidation may also definea delay period or start time, which can be used to stage or sequenceinvalidations within a CDN. For example, if a CDN has k tiers, then ksets of validation instructions (manifests) can be sent to the variousnodes, each set having a different invalidation start time. Each set ofinstructions may include gradual invalidation options. The k sets ofstart times may be used to stagger or stage invalidation by variousgroups of nodes, e.g. by tiers in the CDN. It should be appreciated thatthe start times may be set based on the lengths of gradual invalidationperiods. Those of ordinary skill in the art will realize and understandthat the selection of start times should be sufficient to allow theinvalidation information to propagate sufficiently through each set ofnodes before the next set of nodes (e.g., the nodes in the next tier)begins invalidation processing. However, while preferable, there is norequirement that invalidation information propagate through an entireset of nodes (e.g., an entire tier) before the next set of nodes (e.g.,the next tier) begins the invalidation process.

In some embodiments the system may use feedback information from CDNnodes in order to determine the degree to which invalidation informationhas propagated through the CDN, and this feedback information may beused to initiate or trigger another stage of invalidation in the CDN.For example, in a multitier CDN, the reducer/collector system maymonitor invalidation information from the various tiers and may use thatinformation in order to sequence or stage the provision of invalidationcommands to the different tiers.

Thus, in some aspects, embodiments hereof comprise acomputer-implemented method including: providing, at a first time and toa first group of CD services in a CDN, invalidation information relatingto at least one resource; and providing the invalidation information, ata second time distinct from the first time and to a second group of CDservices in the CDN, the second group of CD services being substantiallydistinct from the first group of CD services. The second time may beafter the first time. In some cases the second group of CD services maybe distinct from the first group of CD services.

In some embodiments hereof, CD services in the CDN may by organized in aCDN hierarchy having multiple tiers , wherein, in some cases, the firstgroup of CD services comprise a first tier in the CDN hierarchy and thesecond group of CD services comprise a second tier in the CDN hierarchy.The first tier may be an origin tier and CD services in the first tiermay obtain content from content sources outside the CDN. In some casesthe second tier may comprise an edge tier.

In some embodiments hereof, the method may also include providing theinvalidation information, at a third time distinct from the first timeand the second time and to a third group of CD services in the CDN, thethird group of CD services being substantially distinct from the firstgroup of CD services and from the second group of CD services.

In embodiments hereof, based on invalidation information at the firstgroup of CD services, CD services in the first group of CD services mayconsider the at least one resource to be not useable.

In embodiments hereof, based on the invalidation information at thesecond group of CD services, CD services in the second group of CDservices may consider the at least one resource to be not useable.

In some cases the second time may occur before some or all of the CDservices in the first group of CD services consider the at least oneresource to be not useable. In some cases the second time may occurafter substantially all of the CD services in the first group of CDservices consider the at least one resource to be not useable.

In some aspects, based on the invalidation information at the secondgroup of CD services, CD services in the second group of CD services mayinvalidate the at least one resource.

In some embodiments hereof, the method may also include receivinginvalidation feedback information from CD services in the first group ofCD services, the invalidation feedback information relating to the CDservices invalidation of the at least one resource, and wherein thesecond time may be determined based on the invalidation feedbackinformation.

The invalidation information relating to at least one resource may beselected from: (i) an invalidation command that specifies a singleresource; and (ii) an invalidation command that specifies a group ofresources.

An invalidation command may specify a group of resources, and in somecases the group may be specified by a pattern.

In some aspects, embodiments hereof comprise a computer-implementedmethod including: assigning each of multiple CD services in a CDN to oneof a plurality of groups of CD services; and providing invalidationinformation relating to at least one resource to each of the pluralityof groups at a different time for each group CD services.

In some cases, based on receipt of the invalidation information at agroup of CD services, CD services in the group of CD services mayconsider the at least one resource to be not useable

The method may also include receiving invalidation feedback informationfrom CD services in the groups of CD services, the invalidation feedbackinformation relating to the CD services invalidation of the at least oneresource, and wherein the time at which the invalidation may be providedto each group may be determined based on the invalidation feedbackinformation in at least one other group of CD services.

In some cases at least one of the groups may be provided invalidationinformation before all of the CD services in another of the groups thathas already received the invalidation information have completedinvalidation of the at least one resource.

Other Methods of Expression-Based Invalidation

Expression based invalidation may be handled in several different ways(including the approaches described above for minimum origin versioninvalidation). The cache may implement an efficient map of cached URLs,or a separate service based on reduction of cache events can maintain anindex of cached resources, and it can translate invalidation patternsinto the list of cached resources per cache. This service can be used bythe control network in a feedback loop that takes invalidation manifestscontaining patterns and localizes them for cache consumption byexpanding the patterns into ground URLs.

Invalidation Completion Tracking

Propagation of invalidation commands can be tracked to closure bytracking mov change events using the reduction mechanism.

System Performance and Customer Experience

The memory required to guarantee safety depends on the number of uniqueinvalidation commands submitted since the beginning of time for thecache. As used here, unique invalidation commands means unique resourcespecifiers (whether ground or group). Commands for the same groupresource submitted over and over occupy only one slot in the commandlist, and have the effect of updating that slot's mov. So if the set ofresource specifiers in invalidation commands for a property is bounded,the space needed to ensure safety is bounded. This situation is shown inFIG. 30-G (which shows a bounded population of invalidation commands).

On the other hand, if the set of resource specifiers is not bounded, adifferent situation arises, as shown in FIG. 30-H (which shows anunbounded population of invalidation commands). In this case, the numberof unique resource specifiers seen in invalidation commands keepsgrowing without bound. Some of these commands are eventually candidatesfor crumpling, and by a certain time, they are assured of beingcrumpled. The time from the arrival of a command to the time where acrumpled version of the command might implicate other unintendedresources is the time-to-implication (TTI) for this property, and it isa function of the invalidation command rate and the memory allocated tothe invalidation command list, as described next.

The invalidation system imposes some configurable memory limit M on thenumber of unique invalidation commands that can be retained at any giventime. Let IR be the average rate of submission of unique invalidationcommands (i.e., commands with unique resource specifiers):

${{IR}\left( {\Delta \; T} \right)} \equiv_{def}\frac{\mspace{14mu} \begin{matrix}{\# \mspace{14mu} {of}\mspace{14mu} {unique}\mspace{14mu} {invalidation}} \\{{commands}\mspace{14mu} {submitted}\mspace{14mu} {during}\mspace{14mu} \Delta \; T}\end{matrix}}{\Delta \; T}$

This can be related to the average time-to-implication (TTI) for aresource in cache by using the value of M, the size of the invalidationcommand memory:

${TTI} \equiv_{def}\frac{M}{IR}$

because as commands roll off the end of invalidation command memory (orinto the crumple zone), their mov constraints may become constraints onall resources in the property in order to ensure safety.

Therefore, to avoid implicating content that would not otherwise beaging out of the system naturally, a sufficiently large TTI should beensured based on the average age of content for the property, defined aswage(P), where:

${{wage}(P)} \equiv_{def}\frac{\sum\limits_{r \in P}^{\;}\; {{size}_{r} \times {age}_{r}}}{\sum\limits_{r \in P}^{\;}{size}_{r}}$

The average age of content should be arranged to be less than the TTI:

wage(P)<TTI

and this may be achieved by constraining IR based on the allocated M andwage(P):

${IR} < \frac{M}{{wage}(P)}$

In practice, wage(P) will initially be an estimate when a property isconfigured, and M will be determined based on an estimated peak valuefor IR. If the value of M exceeds the configurable limits, IR will beconstrained based on some maximum M (unless it is acceptable to reducethe age). If the configured age is less than the actual age, then somefresh content will be implicated (and eventually refreshed) before itages out. However, given a configured IR limit the ingestion ofinvalidation commands may be throttled to stay within this limit andthereby avoid implicating resources before their time.

Overall, this approach provides a reasonable way of predicting theresources needed to support a certain level of invalidation activity.Configuring a property to work within those resources constrains theinvalidation mechanism enough to support the desired level ofinvalidation activity while also ensuring a predictable refresh behaviorfor all of the content in a property.

Alternate Invalidation Approach

An exemplary approach to resource invalidation can be found in U.S. Pat.No. 8,060,613, which is hereby fully incorporated herein by referencefor all purposes. U.S. Pat. No. 8,060,613 describes a resourceinvalidation approach in which a server in a content delivery network(CDN) maintains a list of resources that are no longer valid. When theserver gets a request for a resource, it checks whether that resource ison the list, and, if so, it replicates the resource from a contentprovider's content source (such as an origin server). If the requestedresource is not on the list (of resources that are no longer valid), theserver tries to serve a copy of the requested resource or to obtain acopy from another location in the CDN.

Such an exemplary resource invalidation approach is described in greaterdetail below:

A server in the CDN maintains a list of invalid resources. The serverreceives an indication that at least one resource is no longer valid.This indication may be received from a so-called “master server.” Inresponse to receiving this indication of invalidity, the server causesthe at least one resource to be listed as invalidated.

In response to a request of the server to serve a resource associatedwith a content provider to a client, the server determines whether therequested resource is listed as invalidated. If the requested resourceis listed as invalidated, then the server attempts to replicate anupdated copy of the requested resource on the server from at least onecontent source associated with the content provider. The server thenserves the updated copy of the requested resource to the client. If therequested resource is not listed as invalidated, then, if a copy of therequested resource is not available on the server, the server attemptsto replicate a copy of the requested resource on the server from anotherlocation in the system, and, if successful, then serves the copy of therequested resource to the client. If a copy of the requested resource isavailable on the server, then the server serves the copy of therequested resource to the client.

The other location (from which the server attempts to obtain a copy) maybe another server in the CDN or at least one content source associatedwith the content provider.

The indication that the at least one resource is no longer valid may bein the form of a resource invalidation message identifying one or moreresources that are no longer valid. The message identifying one or moreresources that are no longer valid may use an identifier/identifiers ofthe resource(s). The message may use one or more patterns (e.g., regularexpressions) to identify invalid resources. The regular expressions maydescribe one or more sets of resources to be invalidated. Regularexpressions are well-known in the field of computer science. A smallbibliography of their use is found in Aho, et al., “Compilers,Principles, techniques and tools”, Addison-Wesley, 1986, pp. 157-158.

In some embodiments, the server may send an acknowledgement message forthe resource invalidation message.

In some embodiments, the server may cause the resource invalidationmessage to propagate to other servers in the CDN.

A resource may be considered to be no longer valid (invalid), e.g., ifthe resource is stale and/or if the resource has changed.

In some embodiments the server may delete at least some of the resourcesthat are no longer valid. This deletion may occur prior to any requestfor the at least some of the resources.

The server may be a caching server, and the master server may be anothercaching server.

In another embodiment, as described in U.S. Pat. No. 8,060,613, a serverreceives a first message identifying at least one resource that isstale. The first message may be received from a master server. Inresponse to the first message, the server lists the at least oneresource as pending invalidation. In response to a request of the serverfrom a client to serve a resource that has been listed as pendinginvalidation, the request being the first request for the resource thatis received by the server after the first message has been received, theserver attempts to replicate an updated copy of the requested resourceon the server (e.g., from at least one content source associated withthe content provider), and the server then attempts to serve the updatedcopy of the requested resource to the client.

In some embodiments, the server may propagate the first message to otherservers in the CDN.

The first message may identify the at least one resource that is staleusing an identifier of the at least one resource. The first message mayidentify the at least one resource that is stale using one or morepatterns (e.g., regular expressions). The regular expressions maydescribe one or more sets of resources to be invalidated.

In some embodiments, after listing the at least one resource as pendinginvalidation: the server may send an acknowledgement message indicatingthat the particular server has listed the at least one resource aspending invalidation.

In some embodiments, the first message may be sent (e.g., by the server)to others servers in the CDN. The server may wait for the others of theplurality of servers to acknowledge the first message.

In some embodiments, if a server in the CDN fails to acknowledge thefirst message within a given period, that server may be disconnectedfrom the CDN. In some embodiments, when the server reconnects, theserver may be instructed to flush its entire cache.

In some cases, if a server in the CDN fails to acknowledge the firstmessage within a given period, then the server may be instructed toflush at least some of its cache.

In some embodiments, when all servers have either acknowledged the firstmessage or have timed out, a second message may be broadcast, the secondmessage comprising an invalidation request to all servers to cause theservers to remove the corresponding resource identifiers from the listof resource identifiers pending invalidation.

In some embodiments, a first message is received from a server (e.g., amaster server). The first message identifying at least one resource of acontent provider that is no longer valid. Then, responsive to the nextrequest from a client of a server to serve the at least one resourcethat has been identified as no longer valid, the server obtains anupdated copy of the resource on the server from at least one contentsources associated with the content provider, and then the server servesthe updated copy of the particular resource to the client.

Clusters, Clustering and Peering Clusters and Clustering

As designated intermediaries for given origin service, a CDN generallyprovides a redundant set of service endpoints running on distincthardware in different locations. These distinctly addressed butfunctionally equivalent service endpoints provide options to therendezvous system (discussed below). Each distinct endpoint ispreferably, but not necessarily, uniquely addressable within the system,preferably using an addressing scheme that may be used to establish aconnection with the endpoint. The address(es) of an endpoint may be realor virtual. In some implementations, e.g., where service endpoints(preferably functionally equivalent service endpoints) are bound to thesame cluster and share a virtual address, the virtual address may beused.

In the case of an IP-based system, each distinct endpoint may be definedby at least one unique IP address and port number combination. In anIP-based system where service endpoints are logically bound to the samecluster and share an IP address, each distinct endpoint may be definedby at least one unique combination of the IP address and port number. Insome cases, service endpoints that are logically bound to the samecluster may share a VIP, in which cases each distinct endpoint may bedefined by at least one unique combination of the VIP and a port number.In the latter case, each distinct endpoint may be bound to exactly onephysical cluster in the CDN.

It should be appreciated that not all service types will require or havemulti-agent logical clusters. In such cases, the endpoint may be definedin terms of a real address rather than a virtual address (e.g., an IPaddress rather than a VIP). A virtual address may, in some cases,correspond to or be a physical address. For example, a VIP may be (orcorrespond to) a physical address (e.g., for a single machine cluster).

It should be appreciated that the term VIP is used in this descriptionas an example of a virtual address (for an IP-based system). In generalany kind of virtual addressing scheme may be used and is contemplatedherein. Unless specifically stated otherwise, the term VIP is intendedas an example of a virtual address, and the system is not limited to orby IP-based systems or systems with IP addresses and/or VIPs.

It should be appreciated that, as used herein to describe endpoints in acluster, the term “functionally equivalent” does not require identicalservice endpoints.

For example, two caching endpoint services may have differentcapabilities yet may be considered to be functionally equivalent.

For example, as shown in FIG. 3-A, service endpoints SEP 1, SEP 2 . . .SEP n are logically bound to the same cluster and share an address. Whena logical cluster is within a physical cluster (e.g., when the servicesare on machines behind a switch), the shared address may be a virtualaddress (e.g., a VIP).

A physical cluster of service endpoints may have one or more logicalclusters of service endpoints. For example, as shown in FIG. 3-B, aphysical cluster 304 includes two logical clusters (Logical Cluster 1and Logical Cluster 2). Logical cluster 1 consists of two machines (M0,M1), and logical cluster 2 consists of three machines (M2, M3, M4). Themachines in each logical cluster share a heartbeat signal (HB) withother machines in the same logical cluster. In this example, the firstlogical cluster may be addressable by a first unique virtual address(address #1, e.g., a first VIP/port combination), whereas the secondlogical cluster may be addressable by a second unique virtual address(address #2, e.g., a second VIP/port combination).

In a typical case, a machine may only be part of a single logicalcluster; although it should be appreciated that this is not arequirement.

The machines that share a heartbeat signal may be said to be on aheartbeat ring. In the example cluster shown in FIG. 3-B, machines M0and M1 are on the same heartbeat ring, and machines M2, M3, and M4 areon the same heartbeat ring.

When a service endpoint is bound to a cluster, it means that a bank ofequivalent services are running on all the machines in the cluster andlistening for service requests addressed to that cluster endpointaddress. Preferably a local mechanism (e.g., a load-balancing mechanism)ensures that exactly one service instance (e.g., machine) in the clusterwill respond to each unique service request. This may be accomplished,e.g., by consistently hashing attributes of each request to exactly oneof the available machines and (and of course it is impossible to havemore than one service instance listening per machine on the sameendpoint). Each service instance running on machines in the cluster canbe listening to any number of other endpoint addresses, each of whichwill have corresponding service instances running on all other machinesin the cluster. Those of ordinary skill in the art will realize andunderstand, upon reading this description, that various mechanisms maybe used to allocate/distribute service requests to service instances ina cluster. It should be appreciated that not all types of services needuse the same allocation/distribution mechanisms, and that not allclusters of the same kind of service need use the sameallocation/distribution mechanisms.

In some preferred implementations, each machine is installed on aphysical cluster of machines behind a single shared switch. One physicalcluster may be divided up into multiple logical clusters, where eachlogical cluster consists of those machines on the same physical clusterthat are part of the same HB ring. That is, each machine runs an HBprocess with knowledge of the other machines in the same logicalcluster, monitoring all virtual addresses (e.g., VIPs) and updating thelocal firewall and NIC (network interface card/controller)configurations in order to implement local load balancing across thecluster.

U.S. Pat. No. 8,015,298 titled “Load-Balancing Cluster,” filed Feb. 23,2009, issued Sep. 6, 2011 (the entire contents of which are fullyincorporated herein by reference for all purposes) describes variousapproaches to ensure that exactly one service instance in a cluster willrespond to each unique service request. In a first allocation approach,service endpoints on the same HB ring select from among themselves toprocess service requests. In a second allocation approach, also forservice endpoints on the same HB ring, having selected a serviceendpoint from among themselves to process service requests, the selectedservice endpoint may select another service endpoint (preferably fromservice endpoints on the same HB ring) to actually process the servicerequest. This handoff may be made based on, e.g., the type of request oractual content requested.

Since, in some cases, each machine may be considered to be a peer of allother machines in the cluster, there is no need for any other activeentity specific to the cluster. The database records in theconfiguration and control networks of the CDN are the only things thatare needed to declare the cluster to exist. When cluster configurationschange, machines detect the changes, e.g., via their local Autognomeprocesses (described above). Autognome then launches all services(including HB) and communicates logical cluster changes to HB viaupdates to distinguished local files.

A subcluster is a group of one or more (preferably homogenous) machinessharing an internal, local area network (LAN) address space, possiblyload-balanced, each running a group of one or more collaborating serviceinstances. To external clients, i.e., those not connected to theinternal LAN of the subcluster, the collection of service instances isaddressed as a single service image, meaning that individual externallyvisible physical addresses can be used to communicate with all machinesin the subcluster, though usually one at a time.

Service instances within the subcluster's internal LAN address space canpreferably address each other with internal or external LAN addresses,and may also have the ability to transfer connections from one machineto another in the midst of a single session with an external client,without the knowledge or participation the client.

A supercluster is a group of one or more (preferably homogenous)subclusters, each consisting of a group of one or more collaborating butdistinctly addressed service images. Different service images in thesame supercluster may or may not share a common internal LAN (althoughit should be appreciated that they still have to be able to communicatedirectly with each other over some network). Those connected to the sameinternal LAN may use internal LAN addresses or external LAN addresses,whereas others must use external network addresses to communicate withmachines in other subclusters.

Clusters may be interconnected in arbitrary topologies to formsubnetworks. The set of subnetworks a service participates in, and thetopology of those networks, may be dynamic, constrained by dynamicallychanging control policies based on dynamically changing informationcollected from the network itself, and measured by the set of currentlyactive communication links between services.

An example showing the distinction between physical clusters, logicalsubclusters, and logical superclusters is shown in FIG. 31-A. In thisexample, the machines of physical clusters A and B are subdivided intogroups forming logical subclusters R, S, and T from the machines of Aand logical subclusters X, Y, and Z from the machines of B. Thesesubclusters are then recombined to form logical superclusters I from Rand S, J from T and X, and K from Y and Z. The number of machines thatmay be combined into one subcluster is limited by the number of machinesin a physical cluster, but theoretically any number of logicalsubclusters may be grouped into one supercluster that may span multiplephysical clusters or be contained within one.

Peering, Parenting, and Topology

Peering is a general term referring to collaboration between differentservice instances, service images, sub-clusters, and clusters of thesame service type in some larger sub-network in order to achieve someeffect, typically to improve performance or availability of the service.Though the effect may be observable by the client, the peers involvedand the nature of their collaboration need not be apparent to theclient.

Typically peering occurs between two or more services of the same rankin a larger sub-network, but may also be used to refer to services ofsimilar rank in some neighborhood of the larger sub-network, especiallywhen the notion of rank is not well defined (as in networks with acyclic or lattice topology). Parenting is a special case of peeringwhere a parent/child relationship is defined between services.

Note that the formation of logical clusters from physical elements isdistinct from the formation of larger subnetworks of service instancesrunning on the machines in a cluster. Service specific subnetworkscomprised of interacting service instances may span multiplesuperclusters, which means the superclusters on which those serviceinstances are running may be considered as forming a network (typicallya lattice or hierarchy, see, e.g., FIG. 31-B).

Clustering Assumptions

For preferred implementations, a two-level cluster architecture isassumed, where machines behind a common switch are grouped into logicalsub-clusters, and sub-clusters (whether behind the same switch or ondifferent racks/switches) are grouped into super-clusters. In somepreferred implementations, using, e.g., the systems described in U.S.Pat. No. 8,015,298 titled “Load-Balancing Cluster,” all machines in alogical sub-cluster are homogeneous with respect to the virtual address(e.g., VIPs) they serve (each machine serves the same virtualaddresses—VIPs—as all other machines in the sub-cluster), and machinesin distinct logical clusters will necessarily serve distinct(non-overlapping) sets of virtual addresses—VIPs.

A single switch may govern multiple sub-clusters and these sub-clustersneed not be in the same super-cluster. It is logically possible to haveany number of machines in one sub-cluster, and any number ofsub-clusters in a super-cluster, though those of ordinary skill in theart will realize and understand that physical and practical realitieswill dictate otherwise.

Other features described in U.S. Pat. No. 8,015,298 could be madeavailable as an optional feature of sub-clusters, enabling the transferof connections from one machine to another in the same sub-cluster.

Recall, from above, that U.S. Pat. No. 8,015,298 describes variousapproaches to ensure that exactly one service instance in a cluster willrespond to each unique service request. These were referred to above asthe first allocation approach and the second allocation approach. In thefirst allocation approach, service endpoints on the same HB ring selectfrom among themselves to process service requests. In the secondallocation approach, also for service endpoints on the same HB ring,having selected a service endpoint from among themselves to processservice requests, the selected service endpoint may select anotherservice endpoint (preferably from service endpoints on the same HB ring)to actually process the service request. This handoff may be made basedon, e.g., the type of request or actual content requested.

It is assumed here that for some implementations an additional level ofheartbeat-like functionality (referred to herein as super-HB) exists atthe level of virtual addresses (e.g., VIPs) in a super-cluster,detecting virtual addresses that are down and configuring them onmachines that are up. This super-HB allows the system to avoid relyingsolely on DNS-based rendezvous for fault-tolerance and to deal with theDNS-TTL phenomenon that would cause clients with stale IP addresses tocontinue to contact VIPs that are known to be down. It should beappreciated that a super-HB system may have to interact with theunderlying network routing mechanism (simply bringing a VIP “up” doesnot mean that requests will be routed to it properly). For example, if asub-cluster is to take over another sub-cluster's VIP because the secondsub-cluster is completely down or has lost enough capacity that thesystem will consider it to be down, the routing infrastructure ispreferably informed that the VIP has moved to a different switch. Asnoted earlier, while this discussion is made with reference to VIPs, itshould be appreciated that the system is not limited to an IP-basedscheme, and any type of addressing and/or virtual addressing may beused.

Heartbeat(s) provide a way for machines (or service endpoints) in thesame cluster (logical and/or physical and/or super) to know the state ofother machines (or service endpoints) in the cluster, and heartbeat(s)provide information to the various allocation techniques. A heartbeatand super-heartbeat may be implemented, e.g., using thereducer/collector systems. However, those of ordinary skill in the artwill realize and understand, upon reading this description, that a localheartbeat in a physical cluster is preferably implemented locally andwith a fine granularity. A super-heartbeat may not have (or need) thegranularity of a local heartbeat.

This leads to two extreme approaches to configuring a super-cluster, onerelying on the first allocation approach described above (with referenceto U.S. Pat. No. 8,015,298), with optional super-HB, the other withsuper-HB and optional first allocation approach:

-   -   A super-cluster containing N>1 sub-clusters with 1 machines        -   First allocation approach required, second allocation            approach optional. A super-HB is unnecessary.    -   A super-cluster containing N>1 sub-clusters with 1 machine each        -   First allocation approach not required, second allocation            approach not supported. This requires a super-HB.

Depending on the overhead of the first allocation approach and thefail-over properties of virtual address (e.g., VIP) reconfiguration andrendezvous, it may be advantageous to actually configure a super-clustersomewhere in between these two extremes. On the one hand, the Firstallocation approach system described in U.S. Pat. No. 8,015,298 providesthe most responsive failover at the cost of higher communicationoverhead. This overhead determines an effective maximum number ofmachines and VIPs in a single logical sub-cluster based on thelimitations of the heartbeat protocol. The First allocation approachmechanisms described in U.S. Pat. No. 8,015,298 also imposes additionaloverhead beyond that of heartbeat due to the need to broadcast andfilter request traffic. On the other hand, a VIP-level failovermechanism that spans the super-cluster would impose similar heartbeatoverhead but would not require any request traffic broadcasting orfiltering.

It may be that the optimal case is to have logical clusters with atleast two machines but not much more in order to provide reliable VIPsbut minimize communication overhead due to the First allocationapproach. The benefits of going beyond two machines would be increasedcapacity behind a single VIP, and the enabling of localized contentstriping (described in the section titled “Higher Level Load Balancing”below as Approach A) across a larger group of machines, but the costswould be increased HB overhead which increases as the size of thesubcluster increases, and the broadcast and filtering overhead.Detection of down VIPs in the cluster may potentially be handled withouta heartbeat, using a reduction of log events received outside thecluster. A feedback control mechanism could detect inactive VIPs andreallocate them across the cluster by causing new VIP configurations tobe generated as local control resources.

General Responsibility-Based Peering

In responsibility-based peering, each node in a peer group may assumeone or more discrete responsibilities involved in collaborativeprocessing of a request across the peer group. The peer group can be anarbitrary group of service instances across the machines of a singlesuper-cluster. The nature of the discrete responsibilities depends onthe service type, and the processing of a request can be thought of asthe execution of a chain of responsibilities. The applicable chain ofresponsibilities and the capacity behind each are determined by thepeering policy in effect based on the actual capacity of nodes in thepeering group and a dynamically computed type for each request. Thisallows different request types to lead to different responsibilitychains and different numbers of nodes allocated per responsibility.

Each node has a set of capabilities that determine the responsibilitiesit may have, and responsible nodes are always taken from thecorresponding capable set. A node's capability is further quantified bya capacity metric, a non-negative real number on some arbitrary scalethat captures its relative capacity to fulfill that responsibilitycompared to other nodes with the same responsibility. Both capabilitiesand capacities may change dynamically in response to events on themachine or instructions from the control network, in turn influencingthe peering decisions made by the peer group.

Each service type defines a discrete set of supported request peeringtypes, and a discrete set of responsibilities. A configurable policydefines a mapping from an arbitrary number of discrete resource types tothe request peering type with a capacity allocation for eachresponsibility in the request peering type. This capacity could, forexample, be a percentage of total capacity across all nodes capable offulfilling that responsibility. The policy also defines a responsibilityfunction per request peering type that maps a request and aresponsibility to a set of nodes that have that responsibility for thatrequest. This function is expected to make use of the capacityallocation for that responsibility type, using each node's capacity foreach responsibility it can handle.

There are no specific requirements on the responsibility function otherthan the fact that it should return responsibility sets that are largelyconsistent with the current node capabilities and capacity allocationsover a sufficiently large number of requests.

Ideally responsibilities should change in a predictable way in the faceof capability losses due to node failures, but there is a tradeoff to bemade between the goals of consistency (as exemplified by consistenthashing techniques) and load balancing. Ideally, the initial adjustmentto a capacity loss is consistent, but over time consistency should berelaxed in order to balance the load.

One approach is to manage a ring of nodes per capability, with somearbitrary number of slots on each ring such that Nslots>>Nnodes, andwith an assignment of nodes to intervals of contiguous slots where thenumber of slots assigned to a node is proportional to the node'scapacity for that capability, and the node's centroid on the ring isbased on its node identifier's position in the sorted list of all nodeidentifiers for available nodes (nodes with capacity greater than zero).The responsibility function would consult the ring for theresponsibility in question, consistently hash the resource to a slot onthe ring, and take the slot interval proportional to the capacityallocation for the resource's type. It would then return the set ofnodes allocated to those slots.

In the steady state, all nodes in the peer group should compute the sameassignment of responsible nodes for the same resource, and thus make thesame expectations about which nodes are responsible for what. Undertransient conditions, such as when capabilities and capacities changeand not all nodes have yet become consistent with the same policies,different nodes may temporarily compute slightly differentresponsibility sets. The effect of this inconsistency is mitigated byseveral configurable approaches.

The first of the approaches to mitigate inconsistency depends on theimplementation of the responsibility function. If chosen correctly andconsistent hashing is used to connect a resource to a responsible node,then disruptions in responsibility assignments can be reduced.

The second of the approaches to mitigate inconsistency is that allcapable nodes are expected to take responsibility when necessary, evenwhen they believe they are not responsible, but no node ever asksanother node to be responsible unless it believes that other node isresponsible. If a supposedly responsible node is contacted that actuallyis not responsible, then if that node is available it must takeresponsibility. If it does not respond, the client should choose anothernode from the responsibility set until some upper limit of attempts isreached or the responsibility set is exhausted, at which point theclient should take responsibility and continue on in the responsibilitychain.

The third of the approaches to mitigate inconsistency is that when a newresponsibility allocation is provided (due to a node becoming completelyunavailable or having its capacity metric degraded), the previousallocation and the new allocation are combined over some fade intervalto determine the actual responsibility set used by any node. Dependingon the type of service, it may be desirable to more or less graduallyadapt to the new allocation, and this adaptation is controlled by aresponsibility adaptation policy that combines the output of multipleresponsibility functions, a current fading function and zero or morenewer emerging functions. The fading function is used with someprobability that fades to zero (0) over some fade interval, otherwisethe emerging function is used. If the fading function identifies a nodethat the emerging function claims is unavailable, the emerging functionoverrides the fading function and it uses the emerging function's nodeset. This general approach can be extended to an arbitrary number ofpending emerging functions, to handle periods where the capacityallocations change faster than the length of the fade interval.

Consistency, Balance, and Hash Distributions

When a node loses capacity (completely or partially), the typicalapproach is to use consistent hashing to allocate just the workload thatwas lost (i.e., the requests that hash to the node that lost capacity)to other nodes. A consistent reallocation is one in which the amount ofwork reallocated is the same as the amount of capacity that was lost. Inconsistent hashing, where the workload (responsibility for dealing withcertain resources) is allocated based on their hash, consistency may beachieved if loss of one of N nodes of capacity causes no more than K/Nresources to be reassigned to other nodes, where K represents the sizeof the key space, in this case the number of unique request hashes.

The rationale for this is to minimize disruption, which makes sense inthe short term. But minimizing disruption maximizes imbalance, which isundesirable over the long term. Therefore it is desirable to have anapproach that smoothly adjusts from a consistent adaptation immediatelyfollowing a capacity loss to a balanced adaptation eventually. It shouldbe appreciated that consistent hashing alone does not achieve this.

Another issue with hashing in general, even without capacity loss, isthe actual distribution of workload over a set of hash value intervalsbased on the actual distribution of those request parameters that factorinto the hash. If this is not both stationary and uniform, balance willnot be achieved. Capacity loss exacerbates the issue.

By hashing requests to slots as opposed to directly hashing them toresponsible nodes, the system retains the ability to adjust a node'scoverage of slots ever so slightly over time in order to balance itscapacity with respect to the load represented by the slots. Assumingsuitable information sources based on reductions of the actual requestworkload, the system can compute the actual distribution of workload(i.e. request hashes) over the slots, and use this to adjust a node'scentroid and extent on the slot circle such that its current capacitycovers the current estimate of load across some slot interval. This kindof adjustment improves balance at the expense of consistency, and thismay be done gradually after the initial consistent adjustment tocapacity loss, and eventually reach a new point where load is balanced.

Slot Circles Vs. Metric Spaces

The slot circle provides a simple means to implement consistent hashing.Typically nodes are assigned to slots where the number of slots is equalto the total number of nodes, and holes (capacity dropouts) arereassigned to a neighbor. Thus the hashing of resources to nodes in thiscase (and to slots) is consistent.

With a number of slots much larger than the number of nodes, consistenthashing may still be achieved if the number of slots is fixed, theposition of each node on the circle is fixed, and only reassignment ofholes to neighbors is dealt with. By nudging nodes around the circle,and expanding or shrinking the intervals they cover, consistent hashingto nodes is sacrificed, even though the number of slots has not changed,but this allows us to rebalance the load.

A slot circle is a simple one-dimensional approach, just one of manyways to divide up the workload, assign to capacity carrying nodes, anddeal with capacity losses in a consistent fashion. In general, a finitemultidimensional metric space with a suitable distance metric couldreplace the slot circle, provided requests hash to contiguous regions inthe space, nodes cover intervals of the space, and a scheme exists forinitially consistent adjustments that evolve into eventual load balance.This multidimensionality may also be useful as a means to addressdifferent load requirements in different dimensions.

Cache Peering

This section describes an example of how a set of peering policies basedon the type of resource may be arranged. Those of ordinary skill in theart will appreciate and understand, upon reading this description, thatdifferent and/or other peering policies may be arranged. Aresponsibility based peering policy for a super-cluster determines foreach resource r whether the resource is rejectable, redirectable, orserveable. Serveable resources are further subdivided into non-cacheableand cacheable types. For cacheable resources, the policy assigns eachnode one or two responsibilities taken from the list non-responsible,cache-responsible, and fill-responsible. Non-responsible nodes willavoid caching a resource and tend to proxy it from cache-responsiblenodes; cache-responsible nodes will cache the resource but defer tofill-responsible nodes for the task of filling it remotely. Onlyfill-responsible nodes will issue fill requests to remote parents ororigin servers. If a node is non-responsible it cannot becache-responsible or fill-responsible, but a node that iscache-responsible may also be fill-responsible. It should be appreciatedthat (in this example) a fill-responsible node must also becache-responsible

This approach assumes that any two nodes in a super-cluster arepotential peers with respect to filling and serving a given resource.Other than the manner in which peers address each other, it does notmatter whether the peers are in the same logical sub-cluster or in twodifferent sub-clusters. It is assumed that it is possible for peers inthe same sub-cluster to communicate over back channel IP addresses,whereas peers in different sub-clusters can use public VIPs.

A policy does not actually assign responsibility for specific nodes inadvance, but rather specifies the sizes of the various responsibilitysets relative to the size of the super-cluster, where All is the set ofall nodes in the super-cluster, and N_(All)=|All|.

-   -   N_(CR)(r)≦N_(All), the number of cache-responsible nodes in the        super-cluster for r;    -   N_(FR)(r)≦N_(CR)(r), the number of fill-responsible nodes in the        super-cluster for r;    -   RFT(r), the set of remote fill targets outside the super-cluster        for r.

Policy types are defined in advance for each property based onthresholds for popularity, cacheability, and size of the resource beingrequested. The policy type governing a cacheable response is determinedat request time based on estimates of the resource's popularity,cacheability, and size together with the capabilities of the receivingcluster. The node receiving the request determines its responsibilityrelative to the request by its membership in the followingresponsibility sets which are determined per request by a consistenthash of the request to the ring of nodes in the super-cluster:

-   -   CR(r) is the set of cache-responsible nodes located on the        contiguous interval of N_(CR)(r) nodes on the hash ring centered        at the node to which r hashes.    -   FR(r) is the set of fill-responsible nodes on the contiguous        interval of N_(FR)(r) nodes on the hash ring centered at the        node hashed by the request. Generally FR(r)⊂CR (r).    -   NR(r) is the set non-responsible nodes.

NR(r)=All−(CR(r)∪FR(r))

For each request r, the receiving node knows what degree ofresponsibility it has based on its membership (or not) in each of thesesets (which, in the rest of this document, are referred to as CR, FR,NR, and RFT). If a node x is not cache-responsible (x∉CR), it willeither transfer the connection or proxy the request to a node that iscache-responsible. If it is cache-responsible but not fill-responsible(x∉CR but x∉FR) and does not have the resource in cache, it will fillfrom a node that is fill-responsible. If it is fill-responsible but doesnot have the resource in cache, it will fill the resource from a remotefill target. See Table 2, Peering Behaviors (below). Similar variationsexist when the resource is in cache but is stale. In all cases, thechoice of a node to proxy or fill from is by default an unbiased, randomchoice of any node in the governing responsibility set.

This policy structure is self-reinforcing—it not only relies on but alsoensures the fact that the system will eventually reach a state wherecacheable content is most likely to be cached at all cache-responsiblenodes, and (assuming rendezvous and load balancing distribute requestsevenly over the super-cluster) that all cache-responsible nodes areequally likely to have the given piece of content for which they areresponsible.

TABLE 2 Peering Behaviors Responsi- Target Case Policy Type Cache bilityAction Set 0 Rejectable — — Reject — 1 Redirectable Redirect RFT CR = FR= Ø 2 Serveable, Proxy RFT non-cacheable CR = FR = Ø 3 Serveable,cacheable r ∉ Cache x ∉ FR, Proxy CR Ø ≠ FR ⊂ CR x ∉ CR 4 Serveable,cacheable, r ∉ Cache x ∉ FR, Transfer CR Ø ≠ FR ⊂ CR x ∉ CR 5 Serveable,cacheable, r ∉ Cache x ∉ FR, Fill FR Ø ≠ FR ⊂ CR x ∈ CR 6 Serveable,cacheable, r ∉ Cache x ∈ FR Fill RFT Ø ≠ FR ⊂ CR

Content is effectively striped across the cluster, with each node nstoring only those resources which hash to a CR set that contains thenode n. The number of cache-responsible nodes per resource can be set toan arbitrarily large subset of the cluster based on popularity, withmore popular resources resulting in larger values of N_(CR), thusincreasing the chances that requests to the cluster will hit nodes whichhave the resource in cache.

This responsibility structure may be extended to distinguish differentcaching/filling responsibilities, based on different levels in thememory hierarchy.)

Configuration and Tuning of Cache Peering

It is possible to assign planned quality of service levels to a propertyby defining tiers, and compute the popularity and cacheabilitythresholds necessary to achieve it based on the properties of thelibrary and traffic profile. The library could be divided up into tiers,where each tier corresponds to that portion of the library with expectedpopularity (request rate) over some threshold, and a desired performancemetric (say a cache hit rate) is assigned to each tier, with specialtiers for redirectable, ejectable, and non-cacheable resources. Tierboundaries could be defined based on popularity thresholds or total sizeof the library tier (i.e., the K most popular GB of resources, etc.).

Focusing on the cacheable resources, it is possible to estimate the CPU,memory, and network capacity needed to achieve the QoS targets per tier.Network and memory would likely be the gating factors (combining memoryand disk into one category for now, considering a resource “in cache” ifit is on disk or in memory).

An example of how this may be done for the memory part of theestimation, ignoring the effects of invalidations, is shown here. Thememory m needed to ensure the hit rate for the given tier of the librarymay be estimated by:

${HitRate} = {\frac{N_{CR}}{N} \times \frac{m}{{LibSize}({tier})}}$

Imposing a minimum number of machines N_(CR)=N_(min), compute an upperbound m* on the amount of memory per machine as:

$m^{*} = \frac{{HitRate} \times N \times {{LibSize}({tier})}}{N_{\min}}$

Let m* be the total size of the library tier, LibSize (tier), thenestimate another lower bound on N_(CR):

N* _(CR)=HitRate×N

Then, if N_(R)<N_(min) set:

m=m*

N _(CR) =N _(min)

but if N*_(CR)>N_(min) then set:

N_(CR) = N_(CR)^(*)$m = \frac{{HitRate} \times N \times {{LibSize}({tier})}}{N_{CR}^{*}}$

Similar computations are needed to estimate the client side, fill side,and peer-to-peer bandwidth needed to achieve the targets.

Those of ordinary skill in the art will realize and understand, uponreading this description, that the above technique is only given by wayof example, and is not intended to limit the scope of the system in anyway.

As actual traffic profiles change dynamically, the total size and/orpopularity thresholds corresponding to the boundaries between QoS tierswill change. The same date reduction mechanism that computes popularitymetadata can aggregate over the whole library to determine newpopularity thresholds for a given resource data volume, and these newthresholds can be used to adjust responsibility set sizes for resourcesbased on their new tiers.

Invalidation and Peering Protocol Issues

It is likely that in some implementations HTTP headers will be used toconfirm the responsibility expected of a server by another peer in apeer to peer request and to track the peers that have been involvedwithin the super-cluster in the service of a request, in order avoidcycles and deal with the effect of responsibilities changingdynamically. If a node receives a request for a resource with anexpected responsibility that does not match its current responsibility,it is likely that it had that responsibility very recently or it willhave it in the near future, so it should just behave as if it had itnow.

Cached Location Indexing

The approach described above both relies on and ensures that resourceswill be located at certain nodes in the steady state. Since this relieson a source of popularity and cacheability metadata, it may be useful tocompute and use an index of cached locations, and to use thisinformation in choosing the fill target.

If such an index were used, the system may have to be sure that the newchoices are just a refinement of the choices that could have been madeby the responsibility based approach, otherwise the steady stateguarantees would no longer be guaranteed. This generally means thatchoices of target have to be taken from the intersection of the originaltarget sets with the location index if that intersection is nonempty,otherwise it must be taken from the original target set. For example,nodes ∉CR would instead choose their proxy or transfer target fromIndex(r)∩CR if it is nonempty, otherwise from CR. Similarly for nodeschoosing from FR.

This has no effect on performance in the steady state, since in thatstate:

Index(r)∩CR=CR

Index(r)∩FR=FR

In dynamic transitions due to new versions of content, however, the useof the index (if the latency is low enough) could cause a transientperiod where more of the peer transfers occur from the first targets toget the new version of the resource. This approach may not improveoverall performance in the transient state.

NR→CR→FR vs. NR→FR

Similarly, in some cases it may be considered better to fill directlyfrom FR when a non-responsible node receives a request. As definedabove, it is possible for two-levels of local peering before thefill-responsible node reaches out to a remote fill target. In the steadystate when a cache-responsible node is always contacted first, there isno difference between contacting a cache-responsible versus afill-responsible node, because both will have it in cache with the sameprobability. In transient conditions, it is possible for two local hopsto be performed.

Going directly to a fill-responsible node from a non-responsible nodemay resolve the transient condition more quickly for that one node, butit slows the appearance of the steady state.

Biasing the Peer Choice

The unbiased random choice of a node in a target set can be replacedwith a choice that is more biased, in order, e.g., to control transientbehaviors or further influence load balancing. For example, in somecases, since a machine in a sub-cluster is seeing traffic which isrepresentative of the traffic being seen by all the other members of thecluster, then it is feasible to have each machine make its own localdecision about resource popularity and therefore the size of the variousresponsibility sets. Since the machines are observing the same basicrequest stream, a decision made locally by one of them will be madeapproximately simultaneously by all of them without them needing tocommunicate with each other.

One example would be cache warming. If a new node is added to a cluster,for example, the system might want to reduce the probability with whichthe newly added cache would be chosen as a cache-responsible orfill-responsible node, until its cache crosses some threshold. It couldeven be effectively taken out of the externally visible rotation by notlistening directly to the sub-cluster VIPs and just respond to indirecttraffic from other sub-cluster peers through local IP addresses.

Another example is load balancing. If the load distribution that emergesnaturally from the policy is not balanced, it will tend to stay that wayuntil the traffic pattern changes. Biasing the peer choice can beachieved by choosing a node with a probability that is based the ratioof its actual load to expected load. As this ratio goes up, theprobability of choosing it should go down.

Local, Distributed, and Centralized Responsibility Assignment

It is important for all peers in a peer group to use a consistent viewof responsibility assignments. However, it is neither necessary norfeasible for this view to be identical, since the altruistic approach ofaccepting responsibility when asked ensures that each requestor getswhat they ask for. The larger the differences between each node's viewof responsibility assignments, however, the less efficient the systemwill be. In practice, the computation of responsibilities could becomputed by some combination of centralized, distributed, and localcomputations.

For example, an external centralized source could perform some reductionon data captured from the peer group to determine popularity, andpeering policies could be based on that. Nodes could also perform theirown local computations, assuming the inputs to these computations arereasonably similar across different nodes (which should be true in asubcluster but may not hold across the nodes of different subclusters),and these results could be distributed to other nodes. The centralizedcomputation could also be merged with the local computation. Theadvantage of including the local computation more directly as opposed torelying solely on a centralized or distributed computation is reducedlatency.

Multi-Level Peering

The manner in which machines in a peer group collaborate may also beextended across distinct peer groups in a hierarchy or lattice of peergroups. The responsibility chain that governs the flow of work withinone peer group may terminate with a task that involves reaching outsidethe peer group, and the idea of multi-level peering is to use knowledgeof the target peer group's responsibility structure to make that handoffmore efficient.

For example, as described in the previous section, one possibleresponsibility chain involves the responsibility types non-responsible(NR), cache-responsible (CR), and fill-responsible (FR), where:

-   -   NR nodes proxy to a CR node,    -   CR nodes fill from an FR node (unless they are also FR),    -   FR nodes fill from some remote fill target (RFT)

When a request enters an edge peer group from a client outside thesystem, it will arrive at some arbitrary node in a peer group and behandled with some subsequence of the following sequence:

NR→CR→FR→RFT

where a possible subsequence must be non-empty and may omit a leadingprefix or a trailing suffix (because a possible subsequence starts atany node where a request may enter, and stops at a node where theresponse to the request is found to be cached). The FR node'sresponsibility may involve reaching out to an RFT that is consideredoutside the local peer group at this level, and this RFT may refereither to a remote peer group or to an origin server external to thenetwork.

A multi-level peering approach may, for example, identify the CR nodesfor the resource being requested in the target peer group represented byRFT, and submit the request to one of the CR nodes directly. The mannerin which this is done may depend, e.g., on the manner in which peergroups are networked together. It should be appreciated that it may ormay not be possible to address individual machines in the supercluster,and it may be desirable to target just a single image subcluster via itsVIPs.

If it is possible to address machines directly, individual CR nodesacross the entire remote supercluster may be targeted, and hitting anode that is NR for the request may be avoided, and the rest of thesupercluster's internal peering proceeds as usual. If it is not possibleto address individual machines directly then subclusters need to beaddressed. In this scenario, the remote supercluster's responsibilitystructure may be partitioned, e.g., into two levels, one of whichassigns CR responsibilities for specific resources to entiresubclusters, and then the usual responsibility chain within thesubcluster to decide which nodes within the subcluster are going tocache and fill. Alternatively, the target CR node could be identifiedand its subcluster determined, and the result used. In either case theprobability of hitting an NR node is reduced (although the chances ofthe request arriving at an NR node are not eliminated).

It should also be appreciated that the choice of a particularsupercluster as the RFT for a request can be chosen dynamically fromamong multiple available choices based on a number of factors (whatproperty the request is for, other resource metadata, etc.) In addition,it should be appreciated that the choice of a remote fill targetsupercluster can be based on feedback (i.e., reduction over request loginformation that results in an estimate of the relative cost toretrieving content from a particular supercluster for a specificproperty). The estimated cost (i.e., latency) from each client (cluster)to each server (cluster) for a specific property may be a result of areduction, and each client (cluster) may use this to make their remotefill choices.

Automated Learning of Peering Policies

Recall that a peering policy may classify nodes in a cluster orsupercluster based on the peering responsibility to be assigned to thosenodes. For example, N_(CR)(r) is defined as the number ofcache-responsible nodes in the cluster or super-cluster for resource(s)r, and N_(FR)(r) is defined as the number of fill-responsible nodes inthe super-cluster for resource(s) r.

A responsibility-based peering policy for a given cluster orsuper-cluster comprises, for resource(s) r, (i) an assignment of thenumber of cache responsible nodes for resource(s) r (N_(CR)(r)), and(ii) the number of fill responsible nodes for resource(s) r (N_(FR)(r))for the cluster or supercluster. Recall that the peering policy for acluster or supercluster does not actually assign responsibility forspecific nodes in advance, but rather specifies the sizes of the variousresponsibility sets relative to the size of the super-cluster, where Allis the set of all nodes in the super-cluster, and N_(All)=|All|.

In simplified form, for a given cluster of size N, a peering policy fora set of resources r comprises an assignment of N_(CR)(r) and N_(FR)(r).For the sake of this description, assume that N_(FR)=1.

Ideally, the more popular a resource, and the smaller it is, the morepreferable it is to replicate that resource, i.e., the larger thedesired value of N_(CR) for that resource.

It is desirable to provide a compact responsibility-based peering policythat can be executed at or near a cluster or super-cluster, with aminimal amount of state used in the computation of the policy itself.This desire/goal may be specified as two subproblems:

For a given property (comprising one or more resources), and for acluster or super-cluster of size N:

-   -   (1) define an optimal peering policy (an assignment of N_(CR) to        each resource in the property):

P: Request→[1,N]

-   -   (2) devise an efficient way to compute the optimal policy for a        given resource at request time.

As stated, these problems are considered computationally unsolvable, sowhat is needed is an efficiently computable estimate P*≈P.

One approach is to maintain an index by reduction of request logs (usingthe reducer/collector mechanisms), and to provide the popularity andsize per resource back to the cache (caching service endpoint(s)).However, this approach requires either the communication of apotentially large database to the edge caches or a remote query of thesame database at request time.

A second approach is to learn a function that computers the policy froma configurable set of features extracted from each resource and itsrequest history, and to provide this potentially much smaller functionback to the edge.

Both approaches depend on an initial optimization step that computes thedesired value of N_(CR) as a function of popularity and the overalltraffic profile, trading off the increased storage costs of replicationwith the throughput benefits of caching.

A default policy that bases N_(CR) on local request history and a set ofpre-configured thresholds may be used as an initial default. Thisdefault policy may be replaced if a learned policy can be found thatimproves the resource consumption of the default policy.

Configure a feature space

=F₀×F₁× . . . ×F_(k), where for each feature co-domain F_(i) there is arequest-time computable function ƒ_(i)(Request)→F_(i).

From a sorted reduction of request logs on the feature space

, assign an optimal policy 1≦N_(CR)≦N to each point, thereby defining:FP:

→>[1, N] and implicitly defining P(r)=FP(

), for all r, where features (r)=

.

The request logs may include features f₀, f₁, . . . f_(k), whichpreferably include the size of the resource, the number of hits for thatresource and a count of the number of requests for the resource.

Machine learning techniques (e.g., decision tree learning) may beadapted to generate a function FP* with up to some maximum descriptionlength: FP*:

→[1, N], with the goal that FP*≈FP.

Then define: P*(r)≡FP*(Features(r)), where

Features(r)≡<F ₀(r),F ₁(r) . . . F _(k)(r)>

FIG. 3-Q is a flow chart showing an exemplary process for determining afunction P* that can be efficiently computed at thecluster/super-cluster level.

FIG. 3-R is a graph showing peering policy refinements for resources.

Thus, in some aspects, embodiments hereof may provide automated learningof peering policies for popularity driven replication in contentdelivery frameworks. In some aspects embodiments hereof may provide amethod, operable on one or more devices comprising hardware includingmemory and at least one processor, including: collecting informationabout at least one resource, the information having been determinedbased on (i) a set of features of the at least one resource and on (ii)information about previous requests for the at least one resource;determining a computable function of the set of features of the at leastone resource, the computable function having been determined based onthe information about the at least one resource, the function defining apeering policy for the at least one resource; and providing the functionto at least one service endpoint in a cluster or supercluster.

The peering policy may be for the cluster or super-cluster, and thepeering policy may define: (i) a number of cache-responsible nodes inthe cluster or super-cluster for the one or more resources. The peeringpolicy may also define: (ii) a number of fill-responsible nodes in thecluster or super-cluster for the one or more resources.

The number of fill-responsible nodes may be one. The one or moreresources may include a property.

The computable function may be determined using at least one machinelearning technique.

The at least one service endpoint in the cluster or supercluster may usethe function to determine a number of cache responsible nodes in thecluster for the one or more resources. The at least one service endpointin the cluster or supercluster may use the function to determine anumber of fill responsible nodes in the cluster for the one or moreresources.

Each feature in the set of features of the at least one resource may bedeterminable at request time of the at least one resource.

Information about previous requests for the at least one resource mayinclude information about the number of requests for the at least oneresource.

The set of features of the at least one resource may include a size ofthe at least one resource.

In some cases the method may include collecting second information aboutat least one resource, the second information having been determinedbased on (i) the set of features of the at least one resource and on(ii) second information about previous requests for the at least oneresource; determining a second computable function of the set offeatures of the at least one resource, the computable function havingbeen determined based on the second information about the at least oneresource, the second function defining a second peering policy for theat least one resource; and providing the second function to the at leastone service endpoint in the cluster or supercluster. The second functionmay be distinct from the first function.

The at least one service endpoint in the cluster or supercluster may usethe function to determine a first number of cache responsible nodes inthe cluster for the one or more resources, and the at least one serviceendpoint may use the second function to determine a second number ofcache responsible nodes in the cluster for the one or more resources.The first number of cache responsible nodes may be distinct from thesecond number of cache responsible nodes.

Domain and Binding Names Domain and Binding Names Concepts

Domain (Host) Names

Each request reaching the CDN originates with a request to a subscriberdomain name (e.g., a host or domain name that subscribers advertised totheir users). That subscriber domain host name may be different from thename submitted to the CDN's rendezvous system (which will typically bethe CNAME name for the subscriber's host name defined in the CDNdomain).

Canonical Domain Names (CNAMEs, Supernames)

A subscriber may have one or more subscriber domain names associatedwith their resources/origins. The CDN may assign each subscriber domainname a canonical name (CNAME). DNS resolution of each subscriber domainname subject to CDN service must be configured to map to thecorresponding CNAME assigned by the CDN for that subscriber domain name.

As an example, a subscriber may associate the subscriber domain name“images.subscriber.com” with that subscriber's resources. The CDN mayuse the CNAME, e.g., “images.subscriber.com.cdn.fp.net” (or“cust1234.cdn.fp.net” or the like) with the subscriber domain name“images.subscriber.com.” The CNAME is preferably somewhat related to thecustomer (e.g., textually) in order to allow this name to be visuallydifferentiated from those used by other subscribers of the CDN. In thisexample the supername is “cdn.fp.net”.

In some cases the subscriber domain host name may be retained in a proxystyle URL and Host header in an HTTP request that reaches the CDN.

The CNAME assigned by the CDN may be referred to herein as a supername.When a client name resolution request for a subscriber host name isdirected to a CDN CNAME the name will be resolved using a CDN DNSservice (rendezvous) which is authoritative for the CNAME, and therendezvous service will return a list of VIPs in the CDN that aresuitable for the client to contact in order to consume the subscriber'sservice (e.g., for that subscriber's content). Preferably, therendezvous service will return VIPs that are not only available but havesufficient excess capacity and are in close network proximity to theclient.

In the example above, the subscriber domain name “images.subscriber.com”will be resolved using a CDN DNS service that is authoritative for theCNAME. The DNS service that is authoritative for “images.subscriber.com”may be outside of the CDN DNS service, in which case it will typicallyreturn a CNAME record indicating the supername. From the above example,that might, e.g., be “images.subscriber.com.cdn.fp.net”. Subsequentresolution of that name would then be from the CDN DNS service, andwould return a list of VIPs in the CDN. Those of ordinary skill in theart will realize and understand, upon reading this description, thatother methods may be employed to determine the supername associated withthe subscriber domain name, and that the subscriber domain name maydirectly be a supername.

A similar process may apply within the CDN, when one CDN servicerequests resolution of the domain name of another CDN service (notnecessarily a caching service). The rendezvous may return a list of VIPsdirectly or could redirect the resolution to a CNAME for the internalservice that should be used.

Binding Names (BNAMES)

A binding name (BNAME) is the name to which a CNAME maps for the purposeof binding physical addresses. CNAMES with the same BNAME are, bydefinition, bound to the same physical addresses. While binding namesare usually the same as CNAMEs, it is possible to have multiple CNAMESmap to the same BNAME (the effect of which is to ensure that certainCNAMES will always be bound together).

A mapping or binding (BNAME) is established, mapping binding names(BNAMEs) to subsets of clusters in the CDN. Thus, each BNAME is bound tosome subset of clusters in the CDN. (Clusters are discussed in greaterdetail below.)

It should be appreciated that the concept of a binding name (BNAME) isinternal to the CDN and is not a standard DNS concept. Those of ordinaryskill in the art will realize and understand, upon reading thisdescription, that the same effect as BNAMEs may be achieved in DNS bymapping different CNAMEs to the same physical address.

When DNS-based rendezvous occurs, the CNAME in the request is mappedinternally to a BNAME, for which a set of VIPs currently bound to thatBNAME is defined. The rendezvous service and/or the client then selectsthe appropriate subset of this binding list.

Binding

Binding is the process of establishing that requests for certainsubscriber services (or other internal requests) will be available atcertain endpoints in the CDN. In an embodiment, each request collectionlattice (described below) has an upper subset (a contiguous collectionof ancestor nodes, starting with the maximal nodes in the lattice)consisting solely of domain-limited request collections (i.e., requestcollections that depend only on the domain name). From this subset ofthe lattice the binding domain of the lattice can be derived, the set ofBNAMEs that all matching requests must be relative to. Binding is thenaccomplished in two steps, first each BNAME is bound to some subset ofclusters in the CDN, and then the binding domain (BNAME) projection ofthe original request collection lattice is bound to each cluster basedon the BNAMEs bound there. The projection of the original requestcollection lattice is an equivalent subset based on the subset of BNAMES(every path in the lattice that does not match at least one of theBNAMEs is removed from the projection). If the BNAME to virtual address(e.g., BNAME to VIP) mapping changes, or if the BNAME to terminalrequest collection mapping changes, then the effective binding fromproperties (terminal request collections) to virtual addresses (e.g.,VIPs) changes, and this information will be reflected in the mappingused by rendezvous.

While the BNAMEs in the binding domain of a given request collection donot all have to be bound to the same physical clusters, all requestcollections that have a given BNAME must be bound everywhere that domainname is bound. This is preferable for correctness, because in anembodiment, the rendezvous decision is based solely on the BNAME, so thesystem must be sure that all clusters provided as rendezvous targets fora given domain name will have the ability to handle all requestcollections based on that domain name. The binding of domain projectionsas just described ensures that all relevant request collections will bebound, and that all irrelevant ones will not.

Finally, rendezvous services make use of the current state of BNAMEbindings, and may combine this with knowledge of network weather andeach endpoint's availability, load, and proximity to the client'sresolver to decide how to resolve canonical domain names to endpointaddresses.

Rendezvous

Rendezvous is the binding of a client with a target service. Rendezvousmay occur within and across network boundaries:

-   -   internal services may rendezvous to other internal services;    -   external clients may rendezvous to internal services;    -   internal services may rendezvous to external services; and    -   external clients may rendezvous to external services.

In general, rendezvous may involve several stages, some or all of whichmay need to be repeated on subsequent contacts to target service. Whilerendezvous may be DNS-based, it should be appreciated that the processneed not involve a DNS-based rendezvous service:

-   -   1. A client-side service binding policy is evaluated by the        client, resulting in a list of symbolic service locators and a        reuse policy for the service locator list. This evaluation may        use any information available to the client to determine the        result.    -   2. The list of service locators is evaluated by a rendezvous        service, resulting in a list of physically addressable service        endpoints and a reuse policy for the endpoint list. The location        of the rendezvous service used here is itself resolved using an        earlier instance of rendezvous. The evaluation may use any        information available to the rendezvous service to determine the        result.    -   3. A client-side service binding policy is evaluated by the        client, resulting in a choice of one of the physically        addressable service endpoints, and a reuse policy for that        endpoint. This evaluation may use any information available to        the client to determine the result.    -   4. Any attempted contact of the rendezvous service and or the        target service using the previously determined endpoint may        result in a command to redirect to a different rendezvous        service or target, with a new reuse policy for the result. The        redirection may use any information available to the target        service to determine the result, may specify the new target in        terms of a new client side binding policies, service locators,        or physical endpoints. Depending on the form in which the        redirect command is specified, the client may need to restart        the rendezvous process at an earlier step in order to re-derive        a new endpoint to contact. The client's response to the redirect        may also be influenced by the previously established client-side        binding policy. Any finite number of redirects is possible.

For example:

-   -   The policy in step [1] could specify an explicit list of domain        names or URLs, or it could specify a script to be executed        locally which returns such a list, or it could specify a query        to another service (e.g., a compute service, collector service,        state service, or content delivery service).    -   The policy in step [2] could be a policy, e.g., as described in        U.S. Pat. No. 7,822,871 (the entire contents of which are fully        incorporated herein for all purposes), and information retrieved        from other services could be information about the location of        the resolving client (or the likely client on whose behalf the        request is being made), and information about the state of the        network (both the CDN and the underlying IP network).    -   The policy in step [3] could be a simple as a random choice, or        another local or remote computation or collector-based query.

The reuse policies in each step specify whether the results of that stepmay be reused over multiple service contacts, and if reusable, the timeperiod over which the result of that step may be reused. Time periodsmay be relative to the passage of real time and/or the occurrence offuture asynchronous events.

In general, each service endpoint is addressable within the system sothat it can be identified using the rendezvous system and so that it canbe contacted and/or connected to using whatever connection protocol(s)is (are) in use. In the case of a DNS-based rendezvous system, eachservice endpoint is preferably addressable by one or more domain namesso that it can be found using the DNS-based rendezvous. A serviceendpoint may be operated as a multihomed location with multiple IPaddresses. Thus, when a client asks a DNS-based rendezvous server toresolve the endpoint's domain name the rendezvous system will return oneor more of the addresses associated with that name. That client may thenaccess the service endpoint at one of those addresses.

End to End

As shown in FIG. 3-C, binding occurs at/in many levels: subscriberdomain names (hostnames) map to canonical names (CNAMEs) in the CDN. TheCDN's CNAMEs map to BNAMEs that are bound/mapped to virtual addresses(e.g., VIPs) corresponding to subsets of clusters in the CDN. Eachvirtual address (e.g., VIP) corresponds to one or more physicaladdresses. It should be appreciated that in cases where the virtualaddresses are actual addresses (e.g., where VIPs are actual IPaddresses), the mapping from BNAMEs to virtual addresses to actualaddresses is essentially a mapping from BNAMEs to actual addresses(e.g., to IP addresses).

As an example (involving DNS based rendezvous), as shown in FIG. 3-D,the end to end process from request to response may traverse severallevels of indirection.

Request Processing Request Collections and Binding Domains

Binding is a concept that applies to all service types, not justcaching. Bindings are based on request collections and their bindingdomains. Each request collection defines a set of matching requests to aparticular kind of service based on various attributes of the request.Since each matching request implies a hostname (which implies a CNAME,which in turn implies a BNAME), the binding domain of a requestcollection is the set of BNAMEs implied by the set of matching requests.

When a request collection is bound to a service instance at someendpoint it means that all requests that match the request collectionmay be served from that service instance at that endpoint. Service typesinclude not only caching but also rendezvous, as well as other CDNservices such as configuration, control, reduction, collection, objectdistribution, compute distribution, etc.

Examples of request collections include regular expressions over domainnames (for DNS rendezvous), and regular expressions over URLs (for HTTPservices), but, as will be discussed below, other more complexcharacteristics of requests may be incorporated in the definition ofrequest collections, including any information that is contained in orderivable from the request and its execution environment within andaround the service processing the request. Request collections areorganized into a set of lattices, one per service type per layer, asdescribed next.

Service Configuration Layers

Each service type T defines an arbitrary but fixed number NT ofconfigurable layers of request processing, analogous to anapplication-level firewall. The idea is that the processing of eachrequest proceeds through each layer in turn, possibly rejecting,redirecting, proxying from a peer, or allowing the request to continueto the next layer with a possibly modified runtime environment.

For each layer, a mapping is defined from the request collections intobehavior configurations. The bindings and behavior mappings aredelivered to the service in advance via one or more layer configurationobjects (LCOs) or their equivalent. As each layer is processed in turnfor each request (from layer (NT−1) to layer 0), the behavior of thelayer is defined by the configuration assigned to the matching requestcollection at that layer, and by a discrete local state variable forthat request collection at that layer. The local state variable capturesthe service's disposition toward responding to requests of thatcollection (and changes in this state variable can be used to denotetransitions in the service's local readiness to respond to requests inthat collection). Each layer also defines a default behavior to apply torequests that do not match any node in the hierarchy.

Any given time, the design and implementation of a particular serviceinstance may dictate a certain fixed number of layers, any number oflayers up to some maximum, or an unbounded number of layers. As theimplementation of that service evolves the constraints on the number oflayers may change to accomplish additional degrees of freedom and levelsof modularity in the configuration of that service type. Differentlayers of a service could also potentially be reserved for specificpurposes (such as using some to handle subscriber-specific behaviors,using others to handle behaviors derived from system or service levelpolicies).

Not all request collections in a lattice need to be the terminal resultof matching a request—some are intended as preliminary matches fordescendant request collections. A terminal request collection is a nodein the lattice that may be the terminal result of a request match (allbottoms of the lattice must be terminal, interior nodes may be eitherterminal or nonterminal).

Request Collection Lattices

Each version of a service is designed to have one or more requestprocessing layers. The configuration of a layer is defined via a requestcollection lattice (RCL) and a behavior mapping. The RCL is computedfrom the set of request collections bound to the layer (and all theirancestors), and the behavior mapping maps the behavior identifiersproduced by each terminal request collection to the control resourcesthat implement the behavior.

Each request collection specifies its parent request collections, a setof constraints on matching requests, and an associated configuration(environment settings and a behavior) to be applied to those requests.To compute the configuration applicable to a request the service layerperforms a breadth first search of the hierarchy starting with the topsof the lattice, capturing information along the way, until the requestmatches a node that is either a bottom of the lattice or has no matchingchild nodes. If multiple nodes would match at a given level in thelattice, only one is chosen (the implementation may order the siblingrequest collections arbitrarily, search them in that order, and take thefirst match). Additionally, there may optionally be at most one requestcollection descendant of any given request collection that is defined asthe collection to use if no other descendant collection is matched atthat level (the “else” collection).

The mechanism for computing this function may be configurable in anumber of different ways. There may be a number of discretelyidentifiable languages or schemes for defining request constraints basedon the needs and capabilities of a particular service layer, and theconfiguration of a service layer specifies the scheme and the lattice ofrequest collections to process. Some example constraint schemes might bebased on glob patterns or regular expressions evaluated over attributesof the request (such as the source IP, request URL, request headers,etc. in the case of an HTTP request). Constraint schemes should be suchthat constraints are easy to evaluate based on information takendirectly from the request or on the result of request collectionprocessing to that point in the lattice. This is not strictly necessary,however, and it is conceivable that a constraint scheme would allowfunctional computation of values that depend not only on the request buton other information retrievable in the network (e.g., geographicinformation inferable from the request).

The effects of matching a request collection are to constrain the nextset of nodes to examine and to specify one or more of the followingoptional attributes:

-   -   1. A control environment: (CE) (a list { . . . } of Name=Value        assignments which must be constants, not functions of the        request);    -   2. A request environment: (RE) (another list [ . . . ] of        Name=Value assignments which may be functions of the request);    -   3. A behavior identifier: B (a string); and    -   4. A single layer control instruction <I> (where I is one of a        small number of predefined opcodes governing the flow from layer        to layer).

These attributes incrementally update a single control environment,request environment, behavior identifier, and layer control instructionthat are accumulated as request collections match. In effect, eachmatching node inherits the settings for these attributes by the nodeswhich have previously matched, and may override them.

Control environments are intended as symbolic categorization labels ofthe requests that match to that point, whereas request environmentscapture information from the particular request matched. In the end, thecombination of both of these environments can be thought of as a singleenvironment of name value pairs.

Each terminal request collection (TRC) must be associated with a uniqueBNAME and behavior label. Once a terminal request collection is matchedand none of its children matches, the accumulated control environment,request environment, behavior identifier, and request collection statecompletely specify the behavior of that service layer for that request.

The BNAME of a request collection may be established by an explicitconstraint or implied by another Host or CNAME constraint together withthe mapping:

Host→CNAME→BNAME

which is known by the configuration system. To bind a BNAME to a layerof some service instance means to include the set of all terminalrequest collections with that BNAME (and all their ancestors) in therequest collection lattice for that layer. So the bindings for a serviceinstance are defined by the set of BNAMEs assigned to each of itslayers. This request collection lattice is derived automatically fromthe set of all applicable request collection definitions and the currentbindings, and it must respond automatically to changes in bindingassignments.

The scope of BNAMES will generally be per service type, per layer(though it is also possible to reuse the same request collection latticeacross multiple layers, in which case the same BNAMEs would be used, asdiscussed later).

Layered Request Processing

The general algorithm for processing a request is to compute theapplicable configuration for each layer from the request collectionlattice bound to that layer, apply it, and conditionally move to thenext layer until the last layer is reached or a stop control is issued(see FIG. 3-G). To apply the configuration means to execute thespecified behavior in the context of the environment.

The effect of “executing” a behavior, as far as the layered (requestprocessing) virtual machine (LVM) is concerned can be anything. It couldadd the behavior to a list to be executed later, or execute it now, itis entirely up to the service. For example, the net effect could be toaugment or modify the subscriber/coserver sequence from what it mighthave been had the preceding layers not been executed.

The act of applying the configuration may result in various servicespecific side effects that are of no concern to the layeredconfiguration flow, as well as one side effect that is relevant—themodification of versions of the original request. It is assumed thatthere will be one or more named, possibly modified versions of theoriginal request, along with the unmodified original request. These areof interest to the flow only because one of them must be used whensearching the request collection hierarchy of the next layer. The layercontrol instruction indicates not only control flow (whether processingshould stop after application or continue to the next layer), but italso specifies the named request variant that should be used to indexthe next layer's request collection lattice in cases where the flowcontinues to the next layer. Thus there are essentially two variants ofthe layer control instruction:

-   -   stop causes all subsequent layers to be ignored and the request        processing to be considered complete, or    -   next(R) which indicates that control should flow to the next        layer using named resource variant R as the index of the request        collection hierarchy (where if R is omitted it defaults to the        same request used as the index in the previous layer).

Thus, as shown in FIG. 3-M, the LVM provides a general purpose andconfigurable model of request processing that can be configured andcontrolled in a common way across different service types, and an LVMimplementation interacts with the service specific virtual machine usinga common interface for executing behaviors in the context ofenvironments. It is even conceivable that the LVM and SVM componentscould be distributed across two remotely located implementationcomponents. This technique could be used, for example, to encapsulateservices as layer-programmable services (see, e.g., FIG. 3-N). FIG. 3-Oillustrates how each service has its own LVM front-end, and externalservices may or may not be outfitted with an encapsulating LVM of theirown.

Reuse of a request collection lattice across multiple layers can beuseful to define behaviors that are dependent on or associated with aproperty but are not delivered to the service in the same package as themain configuration for that property. In a sense, the TRC that resultsfrom matching a request against a request collection lattice can be usedto index a behavior that changes from layer to layer, and the matchingprocess need only be done once. To implement this optimization,recognize that two layers have exactly the same bindings (though perhapsdifferent behavior mappings), and use the same lattice for each.

One way to model what happens at a layer is the following set ofstatements showing the match of a request R against a request collectionlattice RCL_(L) for a given layer L, resulting in an environment E_(L)that encodes everything needed to know about the match (static anddynamic). Then merge that environment with the environment inheritedfrom the previous layer E, and execute the behavior implied by theenvironment.

E _(L):=rclmatch(RCL_(L) ,R)

E′:=E⊕E _(L)

R ₀=execute(E′,R)

In this model the rclmatch function models the process of traversing therequest collection lattice, finding the matching request collection, andcomputing the resulting environment. The execute function abstracts theinterface between the layer machine and the underlying service virtualmachine.

Note that the control and request environments have been combined, andit is assumed that the behavior is identified with an environmentvariable. But separating out the part of the matching process which isrelatively static from the part that is captured based on the request ismore likely to be the way it is implemented efficiently. It is alsouseful to factor the behavior specification out of the environment, sothat a behavior mapping can be specified separately from a requestcollection lattice, which also allows them to be reused independently.

In this next model, a match now returns a TRC (which has associated withit a set of attributes corresponding to the static environment of thatnode in the lattice, including a behavior label, TRC.B) along with arequest specific dynamic environment that is computed by the matchingprocess from the request. The dynamic state of the request collectioncan also be modeled as a variable in this environment. Using the matchedTRC, index the layer-specific behavior mapping Behavior_(L) to retrievethe control resource(s) that define the behavior for this layer, andexecute them:

(TRC,E _(L)):=rclmatch(RCL_(L) ,R)

E′:=E⊕E _(L)

Control:=Behavior_(L)(TRC.B)

R′=execute(E′,Control,R)

In general, TRC.B may be considered as a set of any number of behaviorspecifying variables that are used to look up the service specificinstructions to execute at this layer. In some systems, the symbolicbehavior label could be identified by the subscriber and coserveridentifiers which were extracted from the matching request collectionnode, where the request collection lattice in this case is a flat listof aliases with no environment settings (e.g., a GCO). Using thebehavior labels (subscriber and coserver), look up the controlresource(s) that specify the behavior implementation, resulting in thecontrol resource (e.g., a CCS file).

The layered approach to request processing may provide for separatelevels of configuration for each service. Each layer may be configuredwith request collection(s) (with patterns) that cause a reject,redirect, or continue to the next step (possibly with a configurabledelay for throttling).

For example, some or all of the following checks may be made at variouslayers:

-   -   SRCIPCHECK layer {Source IP black/whitelist}    -   ALIASCHECK layer {Is it a bound property?}    -   VIPCHECK {Is it over an acceptable VIP and protocol for this        property?}    -   CRICHECK layer {compute CRI from alias/property, path, and        relevant headers (Content Encodings, languages, Vary headers),        and may allow additional black/whitelist}    -   POPCHECK layer {popularity service check}    -   STRIPECHECK layer {peering (responsibility) check (may result in        special instructions for the next layer e.g., proxy vs. fillPeer        vs. fillSuper)}    -   Normal Application Level request/response processing (with a set        of environment variables, a set of data, and a script).

Those of ordinary skill in the art will realize and understand, uponreading this description, that the above list is given only by way ofexample, and that different and/or other layers or functions may beused. In addition, some or all of the layers described in the examplesabove may be combined.

Service-Specific Virtual Machines

Each service implementation defines a virtual machine model of itsbehavior in response to service requests. This virtual machine modelspecifies a configurable interface, in effect making the service'sbehavior programmable by policies, parameters, and executable proceduresdefined in a configuration specified external to the serviceimplementation. Different configurations may be in effect at differenttimes in the same service implementation.

To enable human users to easily understand and specify behaviors for theservice's virtual machine, a separate configuration language may be usedto specify the desired behavior, and an original configuration expressedin this language may require translation or compilation through one ormore intermediate representations, ultimately resulting in a controllingconfiguration defined in the language of the service's virtual machine.The controlling configuration is defined by the request collectionlattices per layer, and the set of behavior mappings. Each behaviormapping relates behaviors to control resources. A behavior identifier(together with an environment) is the outcome of one layer's worth ofprocessing described in the previous section, and the behavior mappingdefines the set of control resources to “invoke” to implement thatbehavior.

A controlling configuration is delivered in the form of one or morecontrol resources that may provide parameters, policies, and executableinstructions to the service virtual machine, and the service's behaviorfor the original configuration is defined by the execution orinterpretation of the control resources that were derived from it.Control resources may be self-contained or make references to othercontrol resources available in the network.

Though the virtual machine model interface and its configurability arefixed for a given implementation of a service and each service instanceexecutes a single implementation, the controlling configuration for aservice instance may be changed dynamically in response to changes inthe original configuration or changes to any other inputs to any step inthe control resource translation process, including any informationavailable to the network. A controlling configuration may also bedivided up into any number of parts which are independently derived fromseparate original configurations, change dynamically at different times,and affect different aspects of the service's behavior. Furthermore, therelationship between original configuration objects as viewed by aconfiguration service, and the controlling configurations as viewed by aservice virtual machine is many-to-many—changes to one originalconfiguration object may affect the value of many derived controllingconfigurations, and one controlling configuration may be derived frommany original configurations.

Notes on Request Processing

The request processing discussion presented two variants of what happensat a layer. The preferred of which was:

(TRC,E _(L)):=rclmatch(RCL_(L) ,R)

E′:=E⊕E _(L)

Control:=Behavior_(L)(TRC.B)

R′=execute(E′,Control,R)

It should be appreciated that implicit here is that execute depends onthe current state of the underlying service virtual machine, and maychange it as a result. Note too that E′ is a changed version of E, whichaffects the next layer's processing, as does R′ (a modified version ofthe layer's input request). To make the service state change moreexplicit the execute step may be described or modeled as:

(R′,S′):=execute(Control,R,E′,S)

This may be wrapped in a procedure (called process here) that performsone layer of processing (for layer L):

(R′,E′,S′):=process(L,(R,E,S))

This essentially captures all available state that can be used in theprocessing of a request, given that interactions of the service withother services (such as processing responses from outgoing requests)ultimately result in changes to state S.

To simplify this explanation, the opcode part (e.g., next(R) vs. stop)is omitted from this description. Those of skill in the art will realizeand understand, upon reading this description, that the opcode part isincluded in the iteration from layer to layer.

By way of example, FIGS. 3-I to 3-K depict three basic service instanceinteraction patterns (compose, redirect, and delegate, respectively).

As shown in FIG. 3-I, service A constructs the response to R bycomposing one or more (in this case, two) sub-requests to serviceinstances B and C together. It should be appreciated that sub-requeststo service instances B and C can be invoked in any order, including inseries or in parallel. It should further be appreciated that the clientneed not be aware of the involvement of B or C. In FIG. 3-J (redirect),service D replies to the client that generated R with a redirectingresponse, and the client follows this redirect by issuing a request(preferably immediately) to service E. In the case of a redirectingresponse, the client is aware of and participates in the redirect. Asshown in FIG. 3-K (delegate), service F delegates the response to R viaa hidden request to service G, and G responds directly to the client. Inthis case of a delegated response, the client need not be aware that theresponse is coming from a delegate service instance. As used herein, ahidden request is one not visible to the client. This interaction mayalso cascade over arbitrary combinations of redirect, compose anddelegate steps, as shown in FIG. 3-L.

As will be appreciated, the executed behavior may also cause statechanges in other systems and the client. A behavior may involvereturning no response, a redirecting response, or a terminal response tothe client. A redirecting response may direct the client to issueanother request to some other service (preferably immediately), possiblyleading to further redirecting responses and ultimately leading totermination via a terminal response or non-response. Each response ornon-response may affect the state of the client, possibly alteringfuture requests issued by the client. A response received by the clientcan also have the effect of redirecting future independent requests tothe extent that a response to an earlier request encodes information theclient may use for future requests (e.g., as in HTML rewriting).

A behavior may also delegate a request to another service that willrespond directly to the client, or may involve processing of responsesto sub-requests issued to other services, where in each case therequests issued to other services are derived from the current values ofR, E, and S (request, environment, state), which may change from layerto layer.

This interaction may also cascade over a network of service instances,ultimately terminating at service instances that do not issue any moreoutside requests, or at requests to external services.

FIG. 3-L depicts request processing interactions, and FIG. 3-M depictsaspects of an exemplary distributed request processing system accordingto embodiments of the system.

It should be appreciated that the interaction patterns shown in thefigures here are only examples, and are not limiting. In addition, theseexamples focus on location interactions, whereas, as those of skill inthe art will realize and understand, upon reading this description, aresponse may affect the manner in which subsequent requests are issued(since the state of a service or client receiving a response may bechanged).

It should also be appreciated that a request directed to a CD servicemay have information associated therewith, and a request preferablyrefers to a request and at least some of its associated information. Forexample, in the case of an HTTP GET request, the request may beconsidered to include the GET request itself and HTTP headers associatedwith the request (i.e., the HTTP headers correspond to informationassociated with an HTTP GET request). As another example, a request(e.g., an HTTP POST) may have a body or payload associated therewith,and such a request may be considered to include some or all of theassociated body/payload.

Applications

Configuration information may be distributed in various ways across theelements of the request processing system. Information-carrying elementsof the system that may affect the processing of the request may include,without limitation:

-   -   the request itself;    -   the lattice of request collections bindable to a service        instance at some layer;    -   behaviors and other identifiable configuration objects that can        be referred to from requests, request collections, and        configuration objects;    -   the service design (i.e., the particular service implementation        that a service instance executes);    -   the state of the service at the time the request is processed.

The request, behavior, and environment that result at each layer of thematching process may be a function of any and all information availablefrom these sources. As the request, behavior, and environment may bemodeled simply as an environment (variables and their values), the term“environment” is used here as a general way to refer to all of theseitems.

As will be apparent to those of ordinary skill in the art, upon readingthis description, the amount of information that the system maydetermine from a request spans a spectrum. At one end of the spectrum, aminimal amount of configuration information is received from the requestitself, whereas at the other end of the spectrum the request may providethe basis for much more configuration information. In each case,required configuration information not supplied via the request willcome from the other elements.

Two example cases provided here show how information can be distributedacross these elements. As with all examples herein, these are given forpurposes of explanation and description only, and are not intended to bein any way limiting of the system.

Example Case A

In this example, at one end of the spectrum, the environment resultingfrom the matching process receives minimal configuration informationfrom the request itself (e.g., just the protocol, host, and a componentof a URL path), along with a behavior (e.g., a CCS file) assigned to aspecific subscriber property. All information needed to execute anybehavior (e.g., CCS) is embedded in the design of the service, and allother information needed to specify how to serve content (e.g.,resources) for this specific property is embedded in the contents of theidentified behavior (CCS). The behavior has no parameters.

In the examples described here, behaviors may be expressed in CCS files.Those of skill in the art will realize and understand, upon reading thisdescription, that different and/or other schemes may be used to specifybehavior, and the system is not limited to CCS files.

The environment resulting from the matching process in this case isminimal, only specifying the behavior as the name of the behaviorcontrol resource (e.g., a CCS file), while the other information in theenvironment is just the representation of the (possibly modified)request itself.

In these examples, each node is defined as a set of constraints on theenvironment, plus a set of outputs to the environment. The set ofoutputs is the set of assertions that will be made into the environmentif the constraints in the first set are satisfied. That is, if theconstraints of a node of the request collection lattice are satisfied,then the corresponding assertions are made and processing continues. Theconstraints (or their evaluation) may also have side effects ofcapturing values into the environment, and the outputs may refer tovalues in the environment.

In the examples shown in the drawings the two sets (constraints andoutputs/assertions) are shown in curly braces.

As used herein, “% (VAR)” in a string refers to the value of anenvironment variable VAR in a string, either in the capture case or theoutput case. The notation @func(args, . . . ) refers to values that arecomputed by built-in functions on the environment (and the state of thenetwork), and these values may be used to constrain values in theenvironment or to define them. It should be appreciated that this isjust one possible way to represent constraints used by the matchingprocess, and that this notation is used only by way of example.

FIG. 3-N shows an example request collection lattice (RCL) for case Awith unparameterized specific behaviors. In the example in FIG. 3-N, therequest collection lattice has a number of nodes (at the same level),each having a different set of constraints. As shown in the example inFIG. 3-N, in one node the constraints are

{Protocol:PROTA1,Host:HOSTA1,Path:PATHA1}

and the corresponding outputs/assertions are

{Subscriber:A,Coserver:A1,Behavior:“ccs-A-A1”}.

In this case “Protocol”, “Host”, and “Path” are determined from therequest, and “Subscriber,” “Coserver,” and “Behavior” are environmentvalues that are used by the request collection lattice. Accordingly, inthis case, if the constraints in this node are satisfied (i.e., if theprotocol is “PROTA1”, the host is “HOSTA1”, and the path is “PATHA1”),then “Subscriber” is set to “A”, “Coserver” is set to “A1”, and“Behavior” is set to “ccs-A-A1”. Note that the values of the variableconstraints may be constants (e.g., strings or numbers interpretedliterally), patterns, or other symbolic expressions intended todetermine whether the actual value is an acceptable value, possiblycapturing values from the actual value that will be stored in theenvironment if the constraint is satisfied. When these conditions aresatisfied, the configuration will be set to the behavior based on the“Behavior” variable (i.e., “ccs-A-A1”):

Behavior[“ccs-A-A1”].get_config( )

Example Case Z

At the opposite end of the spectrum, one or more generic behaviors maybe defined that accept parameters from the environment. The more genericthe behavior, the more parameters it will tend to rely on. FIG. 3-Oshows an example of this case—an exemplary request collection latticewith parameterized generic behaviors.

In this example, for the sake of simplicity, it is assumed that theservice implementation is the same for either of these cases, isdesigned such that behavior files (e.g., CCS files) can be executed(e.g., via execution of a distinguished function present in all CCSfiles, such as get_config) with parameters from the environment, and theresult of that execution will specify everything about the subscriber asconstants embedded in a data structure passed to the underlying servicevirtual machine.

As shown in FIG. 3-O, a node (“Reseller with Embedded Config Entry”) hasthe constraints:

{Authorization:“Level3/%(Reseller)%(Principal):%(Signature)”}

and the corresponding assertions:

{BillingID1:“%(Reseller)”,

BillingID2:“%(Principal)”,

Secret:@lookupsecret:(“%(Reseller)”,“% (Principal)”)}

If the constraints are satisfied (i.e., if the value of “Authorization”matches the indicated string pattern, where the embedded references to %(Reseller), % (Principal), and % (Signature) may match any substring),then the environment values for Reseller, Principal, and Signature areassigned to those substrings captured from the value of Authorization.The secondary statements further assign the value of BillingID1,BillingID2, and Secret to new values that make use of the recentlyupdated values of Reseller and Principal.

Note that the value of “Secret” is determined as a function(lookupsecret) of two environment variables (Reseller and Principal).

It should be appreciated that the comments in the nodes (text after the“#”) are given only to aid description.

If the constraints on the node “Reseller with Embedded Config Entry” aresatisfied, then the system will check the sub-nodes of that node in theRCL. If any node in the RCL reached, the environment will have valuespassed down (inherited) along the path in the RCL to that node.

One sub-node (“Reseller subcategory”) has constraints:

{Category:“Foo”,Signature:@signature([V1,V2,V3])}

and corresponding assertions

{Behavior:“Generic1”}

If this path is taken, (i.e., if the “Category” is “Foo”, and theSignature is @signature([V1,V2,V3]), then the configuration will beeither

Config=Behavior[“Generic1”].get_config(Env[V1], Env[V2],Env[V3])

or

Config=Behavior[“Generic1”].get_config(Env)

depending on whether the get_config function expects the parameters tobe passed as arguments, or is, itself, responsible for retrieving theparameters from the passed Environment.

Another sub-node (“#Reseller subcategory”) has constraints:

{Category: “Bar”,Signature:@signature([V4,V5,V6])}

and corresponding assertions

{Behavior:“Generic2”}

If this path is taken, the behavior will be

Config=Behavior[“Generic2”].get_config(Env[V4],Env[V5],Env[V6])

or

Config=Behavior[“Generic2”].get_config(Env)

again, depending on how the get_config function expects the parametersto be passed as arguments.

In case A, behavior (CCS) files may be generated with embedded constants(e.g., represented as a sequence of named handler expressions, with theconstants as arguments), and the distinguished function used to invokethe behavior (CCS) would take no arguments. The resulting configurationis then executed by the service virtual machine with the rest of the(possibly modified) request as an argument.

In case Z, a more generic behavior (CCS) file may be generated, wherethe configuration settings are not embedded as constants, but areparameters to the distinguished function that will be called to returnthe configuration. These parameters must therefore come from theenvironment.

The entire request collection lattice may be recast from case A for allproperties to use this representation, or it may just be used forselected properties.

Thus the two cases are just styles of configuration that can be adoptedon a property-by-property basis (or over groups of related properties),differing in the way information is distributed across theinformation-carrying elements.

As an example, the configuration of a case Z-style class of properties(i.e., a meta-property) may expose parameters for billing ID and originserver hostname. A suitably generic behavior (e.g., CCS) that accepts atleast these two parameters with defaults for other parameters would haveto exist in advance. Some other information in the request (e.g., URL orheaders) could be determined in advance in order to be able todistinguish a request as a case Z-style request, e.g., a pattern on thehostname, or a pattern on an authorization value. An authorization valuein the request would preferably contain a valid signature of thecritical request parameters, and the presence of the authorization valuemay be used to indicate a case Z-style request.

A parent request collection may define a hostname constraint, and mayhave patterns that capture the values of the exposed parameters from therequest into the environment, including a reference to the behavior thatcorresponds to the parameterized behavior (e.g., CCS).

A child request collection may then define a constraint on theauthorization value that is a function of the values of the parametersand some secret, where the secret (or a key that can be used to look upthe secret) is declared in the request collection lattice or computed asa result of the matching process, and the secret is also known by thesigner of the request. Any number of these child request collections maybe defined with different secrets. If there are constraints on theconfiguration parameters that are allowable for a given secret (e.g.,ranges of billing IDs), these constraints may also be expressed at thislevel (or below) in the request collection lattice.

The matching process at this level applies the secret to selected valuesin the environment to compute the signature and compare it to the one inthe request (environment) taken from the authorization value. At thispoint, a matching request is considered authorized if the signaturesmatch and the environment has defined values for the exposedconfiguration parameters. The generic behavior may now be invoked (e.g.,the generic CCS) with the extracted parameters to instantiate theconfiguration for this request (if not already instantiated). Thematching process may also continue further down in the lattice, addingadditional parameters to the environment, until it reaches a terminalrequest collection that matches, so different generic behaviors may beused for requests administered under the same secret.

The process may continue over a collection of subsequent requests, asderived requests are submitted to other services (e.g., external, peer,or parent services) in order to construct a response to the originalrequest.

Note also that if the matching process fails for any reason (e.g., ifthe computed signature does not match the contained signature, orparameters needed for the signature are missing, such as the origin),other lattice nodes may be tried for a match, and if no match is foundthe request may be rejected. This is true in general for all nodes inthe lattice.

As noted elsewhere herein, a rejection may be active or passive and mayor may not provide an indication of the rejection. Whether a rejectionis active or passive and the indication (or not) provided may beconfigured as part of a behavior.

The following are some variations of these non-limiting examples:

-   -   There may be multiple “meta-properties,” since the concept        applies to defining classes of configurations and may be useful        for implementing classes of configurations (e.g., something that        is common across all properties of a subscriber, or certain        subscriber types).    -   An extreme case may involve encoding the entire behavior (e.g.,        a CCS file) as the value of a request attribute (parameterized        by other headers in the request).    -   The configured meta-property behavior may be in an initial        layer, the result of which is just to change the bindings in        subsequent layers, possibly involving dynamic loading of new        portions of the request collection lattice for those layers,        allowing them to recognize properties that were not previously        bound.

These various examples (and others) may be combined. For example, FIG.3-P shows an exemplary request collection lattice with mixedparameterization styles, combining sublattices of cases A and Z andothers. Other approaches representing intermediate cases between the twoextremes of cases A and Z are also possible and are contemplated herein.

Request Redirection Through Request/Response Modification

As discussed earlier, an incoming request may be modified so thatsubsequent processing of the request uses a modified form of therequest. Similarly, the requested content may be modified during theresponse processing. Modified request and response processing may causethe client's request to be directed elsewhere for subsequent processing,e.g., to another instance of the delivery service, another deliveryservice, another CD service, another CDN, an origin server, or even somecombination thereof. This can be implemented by having the client directits (possibly modified) request elsewhere, or by directing the (possiblymodified) request elsewhere on behalf of the client. As examples, aprotocol specific to the service could be used (e.g., the redirectresponse code 302 for HTTP), or references in an HTML resource could bemodified, or a client connection could he handed off to other serviceinstance, or the (possibly modified) request could be proxied to anotherservice instance over a different connection.

The modified content may be HTML, which may involve modifying referencesin the content (e.g., URLs). For example, the references may be modifiedso that subsequent requests associated with those references will bedirected somewhere other than to the origin server, such as to one CDNor another. The modified references may refer more generally to a CDservice, requiring a rendezvous step to identify the service instance,or to a specific CD service instance. Such modified references couldalso incorporate location information in a modified hostname for lateruse by a rendezvous service. E.g., the location information could be theIP address of the client, or some other location information derivedfrom the client location and subscriber configuration.

This redirection functionality may be implemented within a CD service,or in request processing logic external to the service itself, or as aspecial redirection CD service.

If the redirection does not require any non-standard behavior by theclient, it is referred to as transparent redirection.

For example, a request for content (e.g., a resource), may result in oneor more of the following:

-   -   content is served by the delivery service.    -   content is modified before or while being served by the delivery        service.    -   the request (possibly modified) is directed elsewhere.

In another example, in the case of a rendezvous service, the clientrequest may be a request to be directed to a service instance. Therendezvous service may modify the request and then respond based on thatmodified request. That response may direct the client to anotherinstance of the rendezvous service or another rendezvous service forsubsequent processing.

In some embodiments, a CD service may be located in front of or at ISPcaches (between client and origin server) to perform redirection ofclient requests made to an origin server or client requests madedirectly to the cache.

In some embodiments, a CD service may be located at (in front of) asubscriber's origin server to perform redirection of client requestsmade to the origin server.

In such embodiments, the CD service may determine which content ispreferably, but not necessarily, served by the CDN instead of by theorigin server, and, to cause delivery of such content by the CDN whendesired. Several factors could be used to determine whether the contentis preferably, but not necessarily, served by the CDN, such as, e.g., CDconfiguration, subscriber configurations, content popularity, andnetwork and server load at the origin server.

Optimizing Geolocation Queries Via Partial Evaluation

Introduction

Geographic location (geolocation) information may be used to processrequests in a CDN. Geolocation queries may be used, e.g., by CD services(e.g., caches) to control the manner in which a request is processedbased on the geographic location of the client, server, or any otherintermediary involved in the request. Such queries may use informationin published geographic databases that typically map IP address rangesto geographic attributes (such as metro areas, regions, countries,etc.). A common application of geolocation analysis is to deny or acceptrequests based on what part of the world a request is coming from.

Geographic databases are typically large (one current IPv4 database instandard form is more than 1 GB, uncompressed, with about 9 millionaddress ranges). However, since both the databases and database querieschange infrequently, it may be suboptimal in general to compute querieson the entire database each time they are made. A technique is describedherein based on partial evaluation, that is, rewriting a given querybased on the current state of a database into an equivalent query on asmaller, classified database. Queries on large remote databases may thuspotentially be replaced with local queries on small local databases.Furthermore, if the databases are small enough, they may even beembedded as data in program configuration scripts (e.g., Luaconfiguration scripts) without the need to reference or distribute theoriginal geographic database.

This approach/technique is useful, e.g., in systems when there is littleor no geographic database support. The approach/technique may also beuseful as a general feature even with geographic database integration,since such a system can make queries more efficient and may reduce theneed to distribute copies of the database or to consult one remotely.The technique may also apply to other request-time queries over otherdatabases, such as those describing the capabilities of user agents(e.g., browsers, mobile devices, etc.).

As used herein, a geographic database may be a sorted list of IP addressranges that assigns to each address range a set of properties, includinggeographic location attributes (such as, e.g., the country name, countrycode, etc.). One common way to use such a geographic database in requestprocessing is to look up the geographic database entry for an IP addressin question (e.g., a client IP address), extract the attributes ofinterest, and make a decision to accept, reject, or modify the requesthandling based on the geographic location of the client's IP address.

In general, a geographic location query can be thought of as aclassifier, that is, something used to classify the request based on itsgeographic location attributes into two or more classes. The processingof the request then depends on the class or classes to which it belongs.In the simple case of accept versus deny, there are two classes, thosethat are accepted and those denied. To implement this in the traditionalmanner with a general purpose geographic database, the database must beavailable on the server making the query or that server must issue arequest to some other server to return the geographic attributes. Then,some other logic may be executed to classify the request based on thegeographic attributes, and a request handling path is chosen based onthe class. Assuming a binary search on the length of the geographicdatabase, this requires O(log(N)) range comparisons to be performed atthe location of the database, followed by whatever processing is done toclassify the resulting geographic attributes at the server issuing thequery. In the case of 9 million address (N=9 million),O(log(N))=O(log(9M)), 23 in the worst case, about 12 on average.

The approach presented here evaluates a query in advance on each rangeentry in the database, classifying each range based on what the outcomeof the original query would have decided for all addresses in thatrange, and then compress the resulting address ranges (combiningadjacent ranges with the same classification). This results in a newdatabase with a set of ranges and class assignments. Additionally, theranges for the class that is most frequently used may be discarded tominimize the size of the resulting database. This partial evaluation ofthe database compresses it down to a shorter set of ranges and classassignments based on what was relevant to the original query, and theoriginal query can be answered by finding the range for any given IPaddress in the shorter list (if it is in the list then return theassigned class, otherwise return the class that was deleted from thedatabase).

More precisely, first model the original query process as aclassification ƒ of the result of a geographic query g₀ given an IPaddress argument:

class=ƒ(g ₀(IP))

where ƒ: GEOGRAPHIC

CLASS defines how geolocation properties map to discrete classificationsmeaningful to the application, and where g₀ is defined by the state ofthe original geographic database DB₀:

g ₀(IP)=G

(IP₁,IP₂ ,G)∈DB₀ & IP₁≦IP≦IP₂

Then define a classified and compressed version of the database withrespect to ƒ:

DB₁=compress({(IP₁,IP₂ ,C)∥(IP₁,IP₂ ,G)∈DB₀ & ƒ(G)=C})

and define a new geographic query function g₁ based on this database:

g ₁(IP)=C

(IP₁,IP₂ ,C)∈DB₁ & IP₁≦IP≦IP₂

such that a query g₁ on the new database is equivalent to the originalcomposed query:

class=g ₁(IP)=f(g ₀(IP))

Example

By way of example, suppose we want to reject requests from certaincountries. The query in this case classifies each address into twoclasses, one that is accepted, and one that is rejected. Starting withtoday's standard form geographic database, which has lines of the form(shown cut off):

43120875|43147263|17|asia|country1|c1|99|unknown . . . .

indicating that IP addresses from 43120875 to 43147263 are believed tobe located in Country1. If the query aims to reject addresses fromvarious countries (e.g., Country₁, Country₂, . . . , Country_(n)), thenwould classify each IP address range as follows:

-   -   If the country is Country₁ or Country₂ or . . . Country_(n),        then class=0.    -   Otherwise, class=1.

Then use the class at request time to reject all addresses with class 0and accept those with class 1. Classifying the database in advanceeffectively discards information not relevant to the decision, andallows us to combine adjacent IP ranges that have the exact same class.This results in a much smaller database with lines like this:

$\begin{matrix}\begin{matrix}\begin{matrix}\begin{matrix}\begin{matrix}{{\ldots \mspace{14mu} 42205184},4246732,1} \\{42467328,42991615,1}\end{matrix} \\{42991616,43253759,0}\end{matrix} \\{43253760,43515903,1}\end{matrix} \\{43515904,43778047,1}\end{matrix} \\\ldots\end{matrix}$

It should be appreciated that the database is smaller not just becausethe lines are shorter, but also because there are fewer lines withbigger ranges. Classifying the current database of 9 million lines(which has 6812 lines that match class 0 for certain countries) resultsin a new, classified database that has only 1401 lines, with 676 lineswith class 0, and 725 lines with class 1. Therefore, the minimaldatabase size needed to answer this query is 676 lines long. The entiredatabase can easily be encapsulated in a programming language such asLua, along with some code to perform a binary search of a client IPaddress on a list of 676 ranges, doing an average of 5 comparisons (10in the worst case) to reach a decision per request.

Note that in some implementations the compression of address intervalsmay need to be configured more precisely to specify exactly how gapswithin a set of ranges of the same class are to be handled. In otherwords, it may be desired to explicitly specify what to do when an IPaddress is received that is not covered by any range in the originalgeographic database, based on the classification of its neighboringaddress ranges. In the example above, all gaps were conservativelyassigned within a set of ranges assigned to one class to have the sameclass, but other approaches are possible, and the database could belarger.

This approach trades off the run-time cost of some pre-processing(performed whenever the database and or an individual query changes) tomake the request time processing faster and potentially runnable with amore compact, local version of the geographic database. Given theassumed low frequency of change of databases (in a preferredimplementation, geographic database updates are typically publishedmonthly) and queries relative to the high frequency of request-timeevaluation of queries, this described approach provides a good tradeoff.

It should be appreciated that whether or not this approach saves spaceoverall depends on the set of queries in use. In a system with about 800coservers using the geographic flag, if each takes a local database of1K, then the total database size would still only be 800K compared to9M, so this approach would potentially save both time and space.

Some embodiments may have an optimal database generated for just the setof queries running in a particular binding, and potentially even shareacross different queries in the same binding, to further reduce space.The updating and redistribution of such boosted queries can also behandled with the architectures described herein. Queries may beconfiguration objects which have control resources derived from themautomatically, dependent on the state of the underlying geographicdatabase and the query description itself. Any caches that need thelatest version of the boosted query will find out via the usualinvalidation mechanisms.

If the aggregate size of boosted queries becomes prohibitively large, anintermediate approach may be used where an intermediate geographic queryservice answers classification queries by pre-computing/reusing thecompressed versions as described above, but amortized over a group ofquery clients instead of just one. The decision to use a local copyversus deferring to a query service can also be made based on aconsideration of compressed database size needed to answer it, and onthe amount of sharing expected across properties.

Example

Geographic location of a requestor may be used to customize the responseto a request. For example, in some cases, a request-response process mayreturn a different and/or customized response to a request based, atleast in part, on the geographic location of the request. Such anapproach allows for delivery of customized resources to differentgeographic locations or regions. Such customization may include, e.g.,language customization or selection and/or the use of customizedlocation-based advertising and the like.

CDN Structure & Topology

FIG. 4-A shows an exemplary CDN 100, which includes multiple caches(i.e., cache services) 102-1, 102-2 . . . 102-m (collectively caches102, individually cache 102-i), rendezvous mechanisms/systems 104-1 . .. 104-k, (collectively rendezvous mechanism(s)/system(s) 104, made up ofone or more rendezvous mechanisms 104-j), collector mechanism /system106 (made up of one or more collector mechanisms 106-1 . . . 106-n),reducer mechanism /system 107 (made up of one or more reducer mechanisms107-1 . . . 107-p), control mechanism/system 108, and configurationmechanism/system 105. The CDN 100 also includes various other mechanisms(not shown), including operational and/or administrative mechanisms,which together form part of an operation /measurement/administrationsystem (OMA system).

Caches 102 implement caching services (which may be considered primaryservices 1016 in FIG. 1-J); rendezvous mechanism(s)/system(s) 104implement rendezvous services (which may also be considered primarydelivery services 1016 in FIG. 1-J); collectors 106 implement collectorservices e.g., services for monitoring, analytics, popularity, logging,monitoring, alarming, etc. (1012 FIG. 1-J), and reducers 107 implementreducer services (1014 FIG. 1-J).

With reference to FIG. 4-A, components of the caches 102, rendezvoussystem 104, collectors 106, and control system 108, each providerespective event streams to reducers 107. The event stream(s) from thecollectors 106 to the reducers 107 contain event information relating tocollector events. Reducers 107 provide event streams to the collectorsbased, at least in part, on event streams they (reducers) obtain fromthe other CDN components. Collectors 106 may provide ongoing feedback(e.g., in the form of state information) to the control system 108regarding ongoing status and operation of the CDN, including status andoperation of the caching network 102 and the rendezvous system 104.Collectors 106 may also provide ongoing feedback (state information) toother CDN components, without going through the control system 108.Thus, as shown in the drawing, collectors 106 may also provide feedback(e.g., in the form of state information) to reducers 107, caches 102,and rendezvous mechanisms 104. The control system 108 may provideongoing feedback (e.g., in the form of control information) to thevarious components of the CDN, including to the caches 102, therendezvous mechanisms 104, the collectors 106, and the reducers 107.

It should be appreciated that other components (not shown) may alsoprovide event streams to reducers 107 and may also receive feedback(e.g., state information) from collectors 106 and control informationfrom the control system 108.

Thus, as will be described in greater detail below, caches in thecaching network 102 may provide information about their status andoperation as event data to reducers 107. The reducers 107 reduce (e.g.,process and filter) this information and provide it to variouscollectors 106 which produce appropriate data from the informationprovided by the reducers 107 for use by the control 108 for controllingand monitoring operation of the CDN. The collectors 106 may also providestate information directly to other CDN components (e.g., to rendezvousmechanisms 104, caches 102, and/or reducers 107). Similarly, entities inthe rendezvous mechanism or system 104 may also provide information toreducers 107 about their status and operation. The reducers 107 reducethis information as appropriate and provide it to the appropriatecollectors 106. The collectors 106 produce appropriate data from theinformation provided by the rendezvous system 104 via reducers 107, andprovide the data in some form to the control 108 and possibly directlyto the rendezvous system 104. Data provided by the rendezvous system 104may include, e.g., load information, status information of the variousrendezvous mechanisms, information about which particular requests havebeen made of the rendezvous system, etc.

As will be explained, data from the caching network components and therendezvous components are preferably provided to the reducers 107 in theform of event streams. The reducers, in turn, provide event stream datato the collectors 106. The caching network components 102 willpreferably pull control data from the control 108, although some controldata may be pushed to the caching network components. The control 108may pull data from the collectors 106, although some or all of the datamay be pushed to the control 108 from the collectors 106. The rendezvoussystem 104 may pull control data, as needed, from the control 108,although data may also be pushed by the control mechanism to therendezvous system. Data provided to the content providers may be pushedor pulled, depending on the type of data, on arrangements with thecontent providers, and on interfaces used by the content providers.

Collectors 106 may also be considered to be part of the operation/measurement/administration (OMA) system. With reference to FIG. 4-B,the roles or functions of collectors (or collector services) 106 may beclassified (logically) within the OMA 109 as one or more of:

-   -   monitors and gatherers 120,    -   measurers 122,    -   analyzers 124,    -   reporters 126,    -   generators 128, and    -   administrators 130.

Those of ordinary skill in the art will realize and understand, uponreading this description, that these logical classifications areprovided merely as descriptive aids, and are not intended to limit thescope of the system in any way. In addition, it should be appreciatedthat some collectors or components of the OMA system may have more thanone classification. While shown in the diagram in FIG. 4-B as separatecomponents, the functionality provided by these various components maybe integrated into a single component or it may be provided by multipledistinct components. Thus, for example, a particular collector servicemay monitor and gather a certain kind of data, analyze the data, andgenerate other data based on its analysis.

The measurers 122 may include load measurers 123 that actively monitoraspects of the load on the network and the CDN. Measurers or measurementdata generators (including load measurers 123) may be dispersedthroughout the CDN 100, including at some caches, at some rendezvousmechanisms, and at network locations outside the CDN, and may providetheir load information to the collectors 106 via reducers 107.

The monitors and gatherers (monitoring and gathering mechanisms) 120 mayinclude load monitors 132, health monitoring and gathering mechanisms134, mechanisms 136 to monitor and/or gather information about contentrequests and content served by the CDN, and rendezvous monitoringmechanisms 137 to monitor and/or gather information about rendezvous.Each of these mechanisms may obtain its information directly from one ormore reducers 107 as well as by performing measurements or collectingother measurement data from the CDN. For example, load monitoring andgathering mechanisms 132 may gather load information from event streamscoming via the reducers 107 and load information from load measurers123. As will be appreciated, the load information from load measurers123 may be provided to the load monitors 132 directly or via one or morereducers. When the rendezvous mechanisms are implemented using the DNS,each rendezvous mechanism may provide (as event data) information aboutthe name resolutions it performs. The rendezvous monitoring mechanisms137 may obtain this information from appropriate reducers.

The reporters (reporter mechanisms) 126 may include reporting mechanisms138, billing mechanisms 140, as well as other reporter mechanisms.

The analyzers 124 may include load analyzers 142 for analyzing loadinformation gathered by the load monitors and/or produced by the loadmeasurers 123; network analyzers 144 for analyzing information about thenetwork, including, e.g., the health of the network; popularityanalyzers 146 for analyzing information about the popularity ofresources, and rendezvous analyzers 147 for analyzing information aboutthe rendezvous system (including, e.g., information about nameresolution, when appropriate), as well as other analyzer mechanisms.

The generators (generator mechanisms) 128 may include rendezvous datagenerators 148 for generating data for use by the rendezvous system 104,configuration data generators 150 generating data for the controlmechanism 108, and popularity data generators 152 for generating dataabout popularity of properties for use, e.g., by the caches 102,rendezvous mechanism 104 and/or the control mechanism 108, as well asother generator mechanisms. Those of ordinary skill in the art willrealize and understand, upon reading this description, that datagenerated by various generators 128 may include state informationprovided to other CDN components or services. For example, therendezvous data generators 148 generate rendezvous state information foruse by the rendezvous system 104.

Those of ordinary skill in the art will realize and understand, uponreading this description, that different and/or other mechanisms may beused or provided in each of the categories. In addition, those ofordinary skill in the art will appreciate that new mechanisms may beadded to the collectors as needed. In particular, customized collectormechanisms may be provided, as needed, to obtain and analyze informationfrom the event streams produced or provided by the reducers.

Those of ordinary skill in the art will realize and understand, uponreading this description, that the ability to provide customized reducerand collector mechanisms for monitoring, gathering, analyzing,reporting, and generating, provides the CDN operators the ability tocustomize operation of the CDN with or without modification of the CDNcomponents. That is, once CDN components have been deployed andconfigured, the CDN can modify its operation based on theinformation/event logs streamed from the CDN components (e.g., caches)without having to modify the CDN components themselves to produce suchinformation. However, as discussed herein, CDN components may bemodified in order to change their roles or flavors, and such changes mayinclude reconfiguring the event streams produced by a CDN component.

FIGS. 4-C and 4-D are simplified versions of FIG. 4-A, showing the useof feedback and control for caches 102 (i.e., machines running cacheservices) and rendezvous mechanisms 104 (i.e., machines runningrendezvous services), respectively. FIGS. 4-E and 4-F correspond to FIG.1-K, and show feedback and control of cache services and rendezvousservices, respectively. Similarly, FIG. 4-G is a simplified version ofFIG. 4-A, showing the use of feedback and control for storage (i.e.,machines running storage services), and FIG. 4-H corresponds to FIG. 4-Gand shows feedback and control of storage services.

It should be appreciated that the various loggers, reducers, gatherers,and other mechanisms are able to provide and/or obtain information aboutcomponents of the CDN and its operation in real-time. As noted, in somecases, collectors may also act as reducers (in that they can consumeevent streams directly from service instances). In those cases thefeedback may be provided without reducers.

CDN Services

Various CDN services, including caches, rendezvous services, reducerservices, collector services, and storage services are each describedhere in greater detail.

Caches and Cache Organization

Caches, Cache Clusters, Cache Cluster Sites

As shown in FIG. 5-A, each CDN cache 102 may be a cache cluster site 202comprising one or more cache clusters 204. The cache cluster site 202may include a routing mechanism 206 acting, inter alia, to provide datato/from the cache clusters 204. The routing mechanism 206 may performvarious functions such as, e.g., load balancing, or it may just passdata to/from the cache cluster(s) 204. Depending on its configuration,the routing mechanism 206 may pass incoming data to more than one cachecluster 204. FIG. 5-B shows an exemplary cache cluster site 202 with pcache clusters (denoted 204-1, 204-2 . . . 204-p).

As shown in FIG. 5-C, a cache cluster 204 comprises one or more servers208 (providing server services). The cache cluster preferably includes arouting mechanism 210, e.g., a switch, acting, inter alia, to providedata to/from the servers 208. The servers 208 in any particular cachecluster 204 may include caching servers 212 (providing caching serverservices) and/or streaming servers 214 (providing streaming serverservices). The routing mechanism 210 provides data (preferably packetdata) to the server(s) 208. Preferably the routing mechanism 210 is anEthernet switch.

Those of ordinary skill in the art will realize and understand, uponreading this description, that a server 208 may correspond, essentially,to a mechanism providing server services; a caching server 212 to amechanism providing caching server services, and a streaming server 214to a mechanism providing streaming server services.

The routing mechanism 210 may perform various functions such as, e.g.,load balancing, or it may just pass data to/from the server(s) 208.Depending on its configuration, the routing mechanism 210 may passincoming data to more than one server 208. FIG. 5-D shows an exemplarycache cluster 204′ comprising k servers (denoted 208-1, 208-2 . . .208-k) and a switch 210′. The routing mechanism 210 may be a CDN serviceproviding routing services.

The cache cluster site routing mechanism 206 may be integrated withand/or co-located with the cache cluster routing mechanism 210.

FIG. 5-E shows an exemplary cache cluster site 202″ with a single cachecluster 204″ comprising one or more servers 208″. The server(s) 208″ maybe caching servers 212″ and/or streaming servers 214″. As shown in theexample in FIG. 5-E, the cache cluster routing mechanism 210″ and thecache cluster site's routing mechanism 206″ are logically/functionally(and possibly physically) combined into a single mechanism (routingmechanism 209, as shown by the dotted line in the drawing).

A cache server site may be a load-balancing cluster, e.g., as describedin U.S. published Patent Application No. 2010-0332664, filed Feb. 28,2009, titled “Load-Balancing Cluster,” and U.S. Pat. No. 8,015,298,titled “Load-Balancing Cluster,” filed Feb. 23, 2009, issued Sep. 6,2011, the entire contents of each of which are fully incorporated hereinby reference for all purposes.

In presently preferred implementations, some of the cache clusterservers 208 that are connected to a particular switch 210 will share thesame virtual IP (VIP) addresses. (Each cache cluster server 208 willalso preferably have a different and unique IP address.) In thesepresently preferred implementations, for the purposes of CDN control,the cache cluster routing mechanism 210 and the cache cluster site'srouting mechanism 206 are logically/functionally (and preferablyphysically) combined into a single mechanism—a switch. In theseimplementations the cache cluster site refers to all of the machinesthat are connected to (e.g., plugged in to) the switch. Within thatcache cluster site, a cache cluster consists of all machines that sharethe same set of VIPs.

An exemplary cache cluster 204 is described in U.S. published PatentApplication No. 2010-0332664, titled “Load-Balancing Cluster,” filedSep. 13, 2010, and U.S. Pat. No. 8,015,298, titled “Load-BalancingCluster,” filed Feb. 23, 2009, issued Sep. 6, 2011, the entire contentsof each of which are fully incorporated herein for all purposes.

It should be appreciated that the servers in a CDN or even in a cachecluster site or cache cluster need not be homogeneous, and thatdifferent servers, even in the same cache cluster may have differentcapabilities and capacities.

Hypothetical CDN Deployment

FIG. 29 shows a hypothetical CDN deployment (e.g., for a small datacenter).

CDN Organization—Tiers and Groups

As noted above, endpoints of each kind of service (caches, rendezvous,collectors, reducers, control) may be organized in various ways.Exemplary cache service network organizations are described here. Itshould be appreciated that the term “cache” also covers streaming andother internal CDN services.

A CDN may have one or more tiers of caches, organized hierarchically. Itshould be appreciated that the term “hierarchically” is not intended toimply that each cache service is only connected to one other cacheservice in the hierarchy. The term “hierarchically” means that thecaches in a CDN may be organized in one or more tiers. Depending onpolicies, each cache may communicate with other caches in the same tierand with caches in other tiers.

FIG. 6-A depicts a content delivery network 100 that includes multipletiers of caches. Specifically, the CDN 100 of FIG. 6-A shows j tiers ofcaches (denoted Tier 1, Tier 2, Tier 3 . . . Tier j in the drawing).Each tier of caches may comprise a number of caches organized into cachegroups. A cache group may correspond to a cache cluster site or a cachecluster (202, 204 in FIGS. 5B to 5D). The Tier 1 caches are alsoreferred to as edge caches and Tier 1 is sometimes also referred to asthe “edge” or the “edge of the CDN.” The Tier 2 caches (when present ina CDN) are also referred to as parent caches.

For example, in the CDN 100 of FIG. 6-A, Tier 1 has n groups of caches(denoted “Edge Cache Group 1”, “Edge Cache Group 2”, . . . “Edge CacheGroup n”); tier 2 (the parent caches' tier) has m cache groups (the i-thgroup being denoted “Parent Caches Group i”); and tier 3 has k cachegroups, and so on. There may be any number of cache groups in each tier,and any number of caches in each group. The origin tier is shown in theFIG. 5-A as a separate tier, although it may also be considered to betier (j+1).

FIG. 6-B shows the logical organization/grouping of caches in a CDN ofFIG. 6-A. In the exemplary CDN 100 of FIG. 6-B, each tier of caches hasthe same number (n) of cache groups. Those of ordinary skill in the artwill know and understand, upon reading this description, that each cachegroup may have the same or a different number of caches. Additionally,the number of caches in a cache group may vary dynamically. For example,additional caches may be added to a cache group or to a tier to dealwith increased load on the group. In addition, a tier may be added to aCDN. It should be appreciated that the addition of a cache to a tier ora tier to a CDN may be accomplished by a logical reorganization of theCDN, and may not require any physical changes to the CDN.

While it should be appreciated that no scale is applied to any of thedrawings, in particular implementations, there may be substantially moreedge caches than parent caches, and more parent caches than tier 3caches, and so on. In general, in preferred implementations, each tier(starting at tier 1, the edge caches) will have more caches than thenext tier (i.e., the next highest tier number) in the hierarchy.Correspondingly, in preferred implementations, there will be more cachesin each edge cache group than in the corresponding parent cache group,and more caches in each parent cache group than in the correspondingtier 3 cache group, and so on. FIG. 6-C, while also not drawn to scale,reflects this organizational structure.

The caches in a cache group may be homogeneous or heterogeneous, andeach cache in a cache group may comprise a cluster of physical cachessharing the same name and/or network address. An example of such a cacheis described in co-pending and co-owned U.S. published PatentApplication No. 2010-0332664, titled “Load-Balancing Cluster,” filedSep. 13, 2010, and U.S. Pat. No. 8,015,298, titled “Load-BalancingCluster,” filed Feb. 23, 2009, issued Sep. 6, 2001, the entire contentsof which are fully incorporated herein by reference for all purposes.

A cache may have peer caches. In some cases caches in the same tier andthe same group may be referred to as peers or peer caches. In general,for each Tier j, the caches in Tier j may be peers of each other, andthe caches in Tier j+1 may be referred to as parent caches. In somecases, caches in different groups and/or different tiers may also beconsidered peer caches. In some aspects, a peer of a particular cachemay be any other cache that could serve resources that the particularcache could serve. It should be appreciated that the notion of peers isflexible and that multiple peering arrangements are possible andcontemplated herein. In addition, peer status of caches is dynamic andmay change. It should further be appreciated that the notion of peers isindependent of physical location and/or configuration.

A CDN with only one tier will have only edge caches, whereas a CDN withtwo tiers will have edge caches and parent caches. (At a minimum, a CDNshould have at least one tier of caches—the edge caches.)

The grouping of caches in a tier may be based, e.g., on one or morefactors, such as, e.g., their physical or geographical location, networkproximity, the type of content being served, the characteristics of themachines within the group, etc. For example, a particular CDN may havesix groups—four groups of caches in the United States, Group 1 for theWest Coast, Group 2 for the mid-west, Group 3 for the northeast, andGroup 4 for the southeast; and one group each for Europe and Asia.

Those of ordinary skill in the art will realize and understand, uponreading this description, that cache groups may correspond to cacheclusters or cache cluster sites.

A particular CDN cache is preferably in only one cache group and onlyone tier.

Various logical organizations/arrangements of caches (e.g., cachegroups) may be achieved using BNAMEs, alone or in combination withCNAMEs.

In general, some or all of the caches in each tier can exchange datawith some or all of the caches in each other tier. Thus, some or all ofthe parent caches can exchange information with some or all of the edgecaches, and so on. For the sake of simplicity, in the drawing (FIG.6-A), each tier of caches is shown as being operationally connectable toeach tier above and below it, and Tier 3 is shown as operationallyconnected to Tier 1 (the Edge Tier). In some CDNs, however, it may bepreferable that the caches in a particular tier can only exchangeinformation with other caches in the same group and/or with other cachesin the same group in a different tier. In some cases, peers may bedefined to be some or all of the caches in the same group. For example,in some CDNs, the edge caches in edge cache group k, can exchangeinformation with each other and with all caches in parent cache group k,and so on.

A content provider's/customer's server (or servers) may also be referredto as origin servers. A content provider's origin servers may be ownedand/or operated by that content provider or they may be servers providedand/or operated by a third party such as a hosting provider. The hostingprovider for a particular content provider may also provide CDN servicesto that content provider. With respect to a particularsubscriber/customer resource, a subscriber/customer origin server is theauthoritative source of the particular content. More generally, in someembodiments, with respect to any particular resource (including thosefrom elements/machines within the CDN), the authoritative source of thatparticular resource is sometimes referred to as a coserver.

A CDN may also include a CDN origin/content cache tier which may be usedto cache content from the CDN's subscribers (i.e., from the CDNsubscribers' respective origin servers). Those of ordinary skill in theart will know and understand, upon reading this description, that a CDNcan support one or more content providers or subscribers, i.e., that aCDN can function as a shared infrastructure supporting numerous contentproviders or subscribers. The CDN origin tier may also consist of anumber of caches, and these caches may also be organized (physically andlogically) into a number of regions and/or groups. The cache(s) in theCDN origin tier obtain content from the content providers'/subscribers'origin servers, either on an as needed basis or in advance on anexplicit pre-fill. The origin tier may comprise one or more originservices.

An origin/content cache tier could also be used to provide a “disasterrecovery” service—e.g., if the normal subscriber origin server becomesunavailable, content could be fetched from the CDN origin server (a formof customized error responses, minimal/static version of the site,etc.). It would be useful to be able to take a periodic snapshot ofcontent of a web site in this way.

When a cache is associated with a cache group, that cache is said to bebound to that cache group, and when a cache is associated with a tier,that cache is said to be bound to that tier. The binding of caches togroups and tiers can be modified during the normal operation of the CDN.It should be appreciated that binding/association is logical, andapplies to a service running on a machine (server). That is, there maybe independent logical groups overlaid on a physical set of machines(servers). These logical groups may overlap.

Mapping Properties to Caches

Each property (or coserver) may be mapped or bound to one or more cachesin a CDN. A property is said to be bound to a cache when that cache canserve that property (or resources associated with that property) toclients. As used here, a client is any entity or service, includinganother CDN entity or service.

One way to map properties to caches is to impose a logical organizationonto the caches (e.g., using sectors). This logical organization may beimplemented, e.g., using BNAMEs and request collections. Sectors may bemapped to (or correspond to) cache groups, so that all of the propertiesin a particular sector are handled by the caches in a correspondingcache group. It should be appreciated that a sector may be handled bymultiple groups and that a cache group may handle multiple sectors. Forexample, as shown in FIG. 6-D, the properties in sector S1 may behandled by the caches in group 1, the properties in sector S2 may behandled by the caches in group 2, and so on. This exemplary logicalorganization provides a mapping from sectors (an organizationalstructure that may be imposed on properties) to groups in the CDN (anorganizational structure that may be imposed on caches in the CDN).Those of ordinary skill in the art will realize and understand, uponreading this description, that some or all of the properties in anyparticular sector may be handled by more than one group, althoughpreferentially, properties in a sector will be handled by the same groupor groups. Thus, as shown in FIG. 6-E, the properties in Sector 3 arehandled by the services (including caches) in Group 3 and the services(including caches) in Group K. It should be appreciated that the mappingof sectors to groups may be dynamic, and may be changed during operationof the CDN.

When a property is associated with a sector, that property is said to bebound to that sector. When a sector is associated with a group, thatsector is said to be bound to that group. The binding of properties tosectors and the binding of sectors to groups may be made independent ofeach other. The binding of properties to sectors may be modified duringnormal operation of the CDN. Similarly, the binding of sectors to groupsmay be modified during normal operation of the CDN.

Each group (or some collection of groups) can be considered tocorrespond to a separate network, effectively providing multiple CDNs,with each group corresponding to a CDN or sub-CDN that provides some ofthe CDN services and sharing some or all of the remaining CDNinfrastructure. For example, the K groups shown in FIG. 6-E may each beconsidered to be a CDN (or a sub-CDN) for the properties in thecorresponding sectors for which the group is responsible. These multipleCDNs (or sub-CDNs) may fully or partially share various other CDNcomponents such as the control mechanism, reducers, and collectorinfrastructure. The rendezvous system may also be fully or partiallyshared by sub-CDNs, and components of the rendezvous system may bepartitioned in such a way that some rendezvous system components (e.g.,DNS servers) are only responsible for a particular group or groups. Inthis manner, properties of various content providers may be segregatedin order to provide greater control and security over theirdistribution. In some cases, each group (sub-CDN) may be unaware of theother groups (sub-CDNs) and of all other properties, other than those inits sectors.

As shown in FIG. 6-F, the services in the K groups of FIG. 6-E aretreated as separate services in separate sub-CDNs. Therefore, e.g., theedge services (including caches) in Group 1 are effectively independentof the edge services (including caches) in Group K and the other groups.Similarly, the parent services (including caches) in Group 1 areeffectively independent of the parent services (including caches) ineach of the other groups, and so on for each tier of services (includingcaches).

It should be appreciated that the configuration and topology of theservices in each sub-CDN may differ from those in other sub-CDNs. Forexample, one sub-CDN may have a different configuration/topology for itsreducer network than those of the other sub-CDNs.

Preferably, a cache's peers will be defined to only include caches inthe same sub-CDN. A peer of a cache may be considered to be any elementin the CDN that can provide that cache with content (or data) instead ofthe cache having to obtain the content from an origin server (or thecontrol mechanism). That is, a peer of a cache may be considered to beany element in the CDN that can provide the cache with information thatcache needs or may need (e.g., content, configuration data, etc.) inorder for the cache to satisfy client requests.

One or more groups of caches (sometimes referred to herein as a segment)may, in conjunction with shared CDN components, form an autonomous CDN.The configuration of the CDN components into one or more sub-CDNs orautonomous CDNs may be made, e.g., to provide security for contentproviders.

With reference to the drawing in FIG. 6-F, an exemplary CDN 100 maycomprise one or more sub-CDNs (denoted in the drawing 101-A, 101-B . . .101-M—collectively sub-CDNs 101). Each sub-CDN may have its owndedicated CDN services, including dedicated caches (denoted,respectively, 102-A, 102-B . . . 102-M in the drawing), dedicatedrendezvous mechanism(s) (denoted, respectively, 104-A, 104-B . . . 104-Min the drawing), dedicated collector(s) (denoted, respectively, 106-A,106-B . . . 106-M in the drawing), dedicated reducer(s) (denoted,respectively, 107-A, 107-B . . . 107-M in the drawing), and/or dedicatedcontrol mechanisms (denoted, respectively, 108-A, 108-B . . . 108-M inthe drawing). There is, however, no requirement that a sub-CDN have anyparticular kind of dedicated CDN services—e.g., dedicated rendezvousmechanisms, or dedicated collectors, or dedicated reducer(s) ordedicated caches or dedicated control mechanisms. Thus, e.g., a sub-CDNmay have dedicated caches and use the shared CDN services for its otherCDN services. As another example, a sub-CDN may have dedicated caches,reducers, collectors, rendezvous services and control services and mayuse some of the shared CDN services.

The exemplary CDN 100 includes various components that may be sharedamong the sub-CDNs. In particular, the CDN 100 includes a shared controlmechanism 108, shared rendezvous mechanisms 104-1, shared collectors106-1, and a shared reducer(s) 107-1. A sub-CDN may rely in whole or inpart on the shared CDN components. In the cases where a sub-CDN hasdedicated rendezvous mechanisms, those dedicated mechanisms preferablyinteract with the shared rendezvous mechanisms. Similarly, in caseswhere a sub-CDN has dedicated collectors, those dedicated collectorspreferably interact with the shared collectors, and similarly in caseswhere a sub-CDN has dedicated reducer(s), those dedicated reducer(s) mayinteract with shared reducer(s).

There is no requirement that a sub-CDN has the same components as anyother sub-CDN in the CDN. Thus, for example, one sub-CDN may have itsown dedicated rendezvous mechanisms while another sub-CDN does not. Incases where a sub-CDN has dedicated CDN services of some kind, thatsub-CDN may have only some of the functionality of those services andmay rely on the shared CDN services for other functionality of thoseservices. For example, a sub-CDN's collector(s) may include somefunctionality for the sub-CDN without including some of the shared CDN'scollector functionality.

Thus, e.g., an exemplary sub-CDN may have its own dedicated caches andshare the remaining CDN components. As another example, a sub-CDN mayhave its own dedicated caches, collectors, and control mechanisms, andshare some of the remaining CDN components. As yet another example, asub-CDN may have its own dedicated rendezvous system, reducers andcollectors, and share some of the remaining CDN components.

The amount and degree of sharing between sub-CDN components and sharedcomponents may depend on a number of factors, including the degree ofsecurity desired for each sub-CDN. In some cases it is preferable toprevent information from a sub-CDN being provided to any other sub-CDN101 of the CDN 100. In some cases it would also be preferable to preventa sub-CDN from obtaining information from any other sub-CDN. It will beappreciated that a sub-CDN may be operated as an autonomous CDN.

As noted, properties may be mapped to sectors. Each property ispreferably in only one sector. Sectors may be mapped to groups. Eachsector may be mapped to more than one group. One or more groups may forma CDN segment. Preferably each group is in only one segment. Eachsegment may be considered to be a sub-CDN, although it should beappreciated that a sub-CDN may consist of multiple segments (e.g., inthe case of a CDN segment comprising multiple groups). The division ofdata (properties) into sectors may be used to provide efficiency to theCDN. The division of the CDN into sub-CDNs, in addition to theefficiencies provided by sectors, provides additional degrees ofsecurity and control over content delivery. As noted above, elements ofthe rendezvous system may also be partitioned and allocated to sub-CDNsor autonomous CDNs.

Rendezvous Services

A rendezvous service may be a service endpoint controlled by the controlmechanism, and the rendezvous system is a collection of one or morerendezvous services controlled by the control mechanism. Rendezvous isthe binding of a client with a target service, and the rendezvous systembinds clients, both within and outside the CDN, to CD services. Forexample, in some implementations, for delivery requests that includedomain names (e.g., hostnames), the rendezvous system maps domain names(typically CNAMEs) to other information (typically IP or VIP addressesor other CNAMEs). It is preferably, but not necessarily, noted thatthese CNAMEs may themselves resolve to machines outside of the CDN(e.g., to an origin server, or a separate CDN, etc.). A rendezvousservice preferably reports various events to a network of reducers. Theevent information may be used for various reasons including for billing,report, and/or control purposes.

The rendezvous system 104 (FIG. 4-A) may be considered to be acollection of rendezvous services operating on various machines in theCDN. The rendezvous services may be organized as one or more networks.As explained in greater detail below, the rendezvous system 104 is usedto affect the binding of a client with a target service. A client couldbe any entity, including a CDN entity, that requests a resource fromanother entity (including another CDN entity). The rendezvous system 104is may be implemented using and/or be integrated with the Domain NameSystem (DNS) and may comprise one or more DNS name servers (serversproviding DNS services). In some implementations, for some kind ofrequests and services (e.g., HTTP requests of caching services), therendezvous mechanisms 104-j preferably comprise domain name serversimplementing policy-based domain name resolution services. Aspects of anexemplary rendezvous system 104 are described in U.S. Pat. No.7,822,871, titled “Configurable Adaptive Global Traffic Control AndManagement,” filed Sep. 30, 2002, issued Oct. 26, 2010, and U.S. Pat.No. 7,860,964 “Policy-Based Content Delivery Network Selection,” filedOct. 26, 2007, issued Dec. 28, 2010, the entire contents of each ofwhich are fully incorporated herein for all purposes.

Storage Services

A storage service may be a service endpoint controlled by the controlmechanism, and a storage system 103 (FIG. 4-G) may be considered to be acollection of one or more storage services operating on variousmachines/nodes in the CDN. The storage services may be organized as oneor more networks. A storage service may run on any/all nodes in a CDNand may provide persistent storage, which may be locally and/or globallyaddressable, preferably for internal CDN usage. As used herein, the termpersistence may refer, e.g., to the characteristic of state thatoutlives the process that created it. A storage service preferablysupports read, write, update, and delete operations.

A storage node may have rights associated therewith that may be used tocontrol access (such read, write, updated, delete, etc.). For example,some nodes may only be allowed to read data stored at a storage serviceendpoint, whereas other nodes may be allowed to perform write and deleteoperations at that storage endpoint.

A storage service may be implemented, at least in part, with webprotocols (e.g., HTTP, HTTPS, FTP, etc.) or with some other protocol.

Fill Services

A fill service may be a service endpoint controlled by the controlmechanism, and a fill system 113 (FIG. 4-I) may be considered to be acollection of one or more fill services operating on variousmachines/nodes in the CDN. The fill services may be organized as one ormore networks. A fill service may run on any/all nodes in a CDN and mayprovide a source from which other services can obtain resources. Thefill services may assume the responsibility of obtaining/providingresources on behalf of other CD services in the CDN. It should beappreciated that a fill service need not necessarily keep a copy of anyresource that it may provide in response to a fill request.

A fill service may be implemented, at least in part, with web protocols(e.g., HTTP, HTTPS, FTP, etc.) or with some other protocol.

Origin Services

An origin service may be a service endpoint controlled by the controlmechanism, and an origin system 115 (FIG. 4-K) may be considered to be acollection of one or more origin services operating on variousmachines/nodes in the CDN. The origin services may be organized as oneor more networks. An origin service may run on any/all nodes in a CDNand may be used to provide a true or definitive or authoritative versionor copy of a resource. It should be appreciated that an origin servicemay also be considered a special case of a fill service in that it is asource from which other services may obtain resources.

An origin system may provide an external portal (e.g., via an API or thelike) to a CDN, whereby external users (e.g., content providers,subscribers, and CDN customers) may provide (e.g., upload) true copiesinto the service and thus into the CDN. Thus, e.g., an origin system mayprovide a place for content ingestion into a CDN from external sources(e.g., customers' origin servers). It should be appreciated that originservers operated by a content provider are typically not part of theorigin system of a CDN but may be used by the CDN's origin system as alocation from which the CDN may obtain resources associated with thatcontent provider.

An origin service may be implemented, at least in part, with webprotocols (e.g., HTTP, HTTPS, FTP, etc.) or with some other protocol.

Control Control Mechanism

The control mechanism 108 (FIG. 4-A) keeps/maintains the authoritativedatabase describing the current CDN configuration. A control mechanismmay, in some cases, be considered, logically, as a loosely coupledcollection of sites (referred to herein as control sites) whichcollaboratively maintain and publish a set of control resources to theCDN's components (such as to the CDN's caching network). These resourcesinclude control metaobjects which describe real world entities involvedin the CDN, configuration files which affect the network structure ofthe CDN and the behavior of individual nodes, and various directoriesand journals which enable the CDN to properly adapt to changes.

The control mechanism 108 may comprise multiple databases that are usedand needed to control and operate various aspects of the CDN 100. Thesedatabases include databases relating to: (i) system configuration; and(ii) the CDN's customer/subscribers. The control mechanism data aredescribed in greater detail below.

Information in these databases is used by the caches in order to servecontent (properties) on behalf of content providers. E.g., each cacheknows when content is still valid and where to go to get requestedcontent that it does not have, and the rendezvous mechanism needs dataabout the state of the CDN (e.g., cluster loads, network load, etc.) inorder to know where to direct client requests for resources.

In some implementations, control mechanism data may be replicated acrossall machines in the control mechanism cluster, and the control mechanismcluster may use methods such as voting to ensure updates and queries areconsistent. E.g., in some implementations (with a cluster of fivemachines), the commits only occur if three of the five cluster machinesagree to commit, and queries only return an answer if three of the fivecluster machines agree on the answer. The use of voting is given as anexemplary implementation, and those of ordinary skill in the art willrealize and understand, upon reading this description, that differenttechniques may be used in conjunction with or instead of voting onqueries. For example, techniques such as using signed objects to detectcorruption/tampering may be adequate. In some cases, e.g., the systemmay determine that it can trust the answer from a single server withoutthe overhead of voting.

In some embodiments the control mechanism 108 may use a distributedconsensus algorithm—an approach for achieving consensus in a network ofessentially unreliable processors.

The inventors realized that different degrees of consensus for differenttypes of CDN data would be acceptable for most CDN implementations.

The control mechanism 108 controls operation of the CDN and is describedin greater detail below. The control mechanism 108 is preferably made upof multiple control services 1010 (FIG. 1-J) running on machines in theCDN. Physically, the control mechanism 108 may consist of a set ofgeographically distributed machines, preferably connected via high-speedcommunication links. E.g., five machines located in New York, SanFrancisco, Chicago, London, and Frankfurt. Logically, the controlmechanism 108 may act as a single, robust data base/web servercombination, containing configuration data and other data used/needed bythe CDN.

Although only one control mechanism 108 is shown in FIG. 4-A, it shouldbe appreciated that a CDN may have more than one control mechanism, withdifferent control mechanisms controlling different aspects or parts ofthe CDN. In addition, a control mechanism is preferably configured in ahierarchical manner, as will be described in greater detail below.

It should be appreciated that, from the point of view of other CDNcomponents/services (e.g., caches, the rendezvous mechanisms, etc.), thecontrol mechanism is the single source of certain required data.Similarly, the components that provide data to or for use by the controlmechanism (e.g., the OMA) consider it to be a single entity. The otherCDN components are therefore agnostic as to the actual implementation ofthe control mechanism—they need neither know nor care about the controlmechanism's underlying implementation.

The control mechanism 108 is preferably addressable by one or moredomain names so that it can be found using the DNS. For the sake of thisdescription, the domain name control.fp.net will be used for the controlmechanism 108. In a preferred implementation the control mechanism mayconsists of distinct and geographically distributed control mechanismsand may be operated as a multihomed location with multiple IP addresses.Thus, when a client asks a DNS server to resolve the control mechanism'sdomain name (e.g., control.fp.net) the DNS will return one or more ofthe IP addresses associated with that name. That client may then accessthe control mechanism at one of those addresses. It should beappreciated that the DNS will preferably provide the client with arendezvous to a “nearby” control mechanism server or servers (i.e., to“best” or “optimal” control mechanism server(s) for that client),similar to the manner in which clients rendezvous with CDN servers. Inother words, internal components of the CDN (cache servers, controlmechanisms, etc.) may use the same rendezvous mechanisms as are used byentities outside the CDN to rendezvous with CDN components. In somecases the various control mechanisms may have the same IP address, inwhich cases routing tables may direct a client to a “best” or “optimal”control mechanism. This result may also be achieved using an anycast IPaddress.

Control mechanism configurations, exemplary architectures and operationare discussed in greater detail below.

Data Collection

The CDN preferably collects data relating to ongoing and historicaloperations of the CDN (i.e., of the CDN components or services) and mayuse that data, some of it in real time, among other things, to controlvarious other CDN components. For example, data relating to resourcesrequested and/or served by the various caches may be used for or byoperational and/or measurement and/or administrative mechanisms. Inaddition, such data may be used by various analytics and monitoringmechanisms to provide information to other CD services (e.g., to therendezvous system and to the control service). In general, any datacollected and/or produced by any machine or service in the system (e.g.,via event streams to the reducer system) may be used (alone or withother data of the same and/or different types) to control other aspectsof the system (sometimes in real time or online—i.e., where data areused as they arrive). The following sections describe embodiments ofdata collection schemes.

Log Data and Event Data

Each component group of components of the CDN (i.e., each service) mayproduce log data for use (directly or indirectly, “as is” or in somemodified or reduced form) by other components or groups of components ofthe CDN (i.e., by other CDN services). For example, each of the cachesmay produce one or more streams of log data relating to their operation.

Log data provided by each component may include any kind of data in anyform, though data are preferably produced as a stream of data comprisinga time-ordered sequence of events. Those of ordinary skill in the artwill realize and understand, upon reading this description, that it isnot possible for the multiple components of the CDN to have perfectlysynchronized clocks, and, as will be explained below, suchsynchronization is neither required nor presumed. In preferredimplementations, however, clocks are kept within a few thousandths of asecond of each other (using NTP—the Network Time Protocol).

In presently preferred implementations, each CDN component provides(e.g., pushes) each stream of log data that it produces to at least oneknown address or location (corresponding to a reducer or collector). Itshould be appreciated, as will be explained below, that the address orlocation to which each stream is to be directed is configurable andchangeable. The use of multiple locations (i.e., of multiple reducers orcollectors) for redundancy is discussed below.

Service Logs

During operation, each CDN service (e.g., a cache service, a rendezvousservice, a reducer service, a collector service, a control service,etc.) produces information that is used or usable by the service itselfand, possibly, by other components of the CDN. The information producedmay include information about the status of the service, its current orhistorical load, CPU or storage utilization, etc. In the case of a cacheservice, the information may include information about what it isserving, what it has served, what it has stored, and what is in itsmemory. While it may be desirable to have some of this informationstored locally on the machine operating the service (e.g., as logfiles), it is also desirable to have at least some of this informationmade available (directly or in some other form) to other CDN components.

Accordingly, each CDN service produces one or more log streams (of eventdata) which can be obtained by other CDN components (e.g., via reducers107 and possibly collectors 106). Preferably log data from each CDNcomponent (e.g., service) are streamed by the component in the form ofone or more continuous data streams, as explained below.

CDN Component/Service Logging Architecture

Each CDN component (e.g., service) can preferably generate multipleloggable items. These loggable items may be based on measurements andinformation about the component itself (e.g., its load, capacity, etc.)and/or on measurements and/or information about operation of thecomponent within or on behalf of the CDN (e.g., information aboutcontent stored, requested, served, deleted, etc.). Loggable items arethe individual values or sets of related values that are measured andemitted over time by the component. Each item has a name and adefinition which explains how to interpret instances of the value (aswell as how it should be measured). While the set of loggable items thata component can emit at any time may be fixed by the design of thecomponent, it should be appreciated that the actual loggable itemsgenerated by each component may be dynamically configured and may bemodified during operation of the component.

A log event is a time-stamped set of loggable item values that areproduced by the component. It is essentially the assertion by thecomponent that each of the contained log items had the given value atthe given time (according to the local clock of the component). The logevent may also include other independent variables defining the scope ofthe measurement. The grouping of loggable items into log event types ispreferably fixed by the design of the component.

Each CDN component includes one or more configurable log event producersthat each generates a stream of time ordered log events from theloggable items generated by the component. The log events produced by alog event producer may be consumed by one or more configurable logstreams on the component. Each log stream on the component listens forcertain events sent from one or more event producers and then orders andformats those events according to selected log file styles.

A CDN component may have multiple log event producers (e.g., one pervcore) and multiple log streams. As used herein, the term “vcore” meansVirtual CPU core or simply “thread” or “thread of execution.” As shownin the example in FIG. 7-A, which shows parallel logging to multiple logstreams, an exemplary component has N log event producers (collectivelydenoted 902), each producing corresponding log events (N≧1). Anexemplary component also has K log streams (K≧1, collectively denoted904), each producing corresponding log records. As can be seen in thedrawing in FIG. 7-A, the log events produced by each log event producermay each be provided to (and so consumed by) each of the K log streams.

The possible loggable items and events that can be generated by a CDNcomponent (e.g., a cache server or a rendezvous mechanism) arepreferably statically designed into the component, and the log eventproducer(s) for each component are preferably configured/selected aspart of that component's initialization (initial configuration). Notethat the log event producer(s) for a component need not be static forthe life of the component (e.g., the component may be reconfigured usingthe Autognome service). The set of log streams associated with a CDNcomponent may be initialized at component initialization time based,e.g., on per node configuration data, and may change dynamically.

Log event producers can emit events in arbitrarily large batches, andlog streams must order these events.

FIG. 7-B shows a single log event producer 902′ in greater detail.Loggable items are generated and/or produced by various measurement andlog item generator mechanisms. The log event producer 902′ in thedrawing includes n such log item generator mechanisms (denoted M0, M1 .. . Mn), each producing corresponding loggable items. For example, thelog item generator M0 produces loggable items of type 0; the log itemgenerator M1 produces loggable items of type 1, and so on. These logitem generator mechanisms, as noted above, are preferably staticallydesigned into the CDN component, and configured during the CDNcomponent's initial configuration in the CDN.

Those of ordinary skill in the art will realize and understand, uponreading this description, that these various loggable item generatormechanisms may be implemented in hardware, firmware, software, or anycombination thereof.

A log event is a loggable item associated with a time. A log eventgenerator 906 in the log event producer 902′ consumes loggable itemsfrom the log item generator mechanism(s) and produces a correspondingsequence of log events 908 (a time-ordered sequence of loggable items)from the loggable items and using a time from a clock 910. Thus, asshown in FIG. 7-B, the sequence of log events 908 consists of a sequenceof loggable items ordered by time (e.g., at times T[K] T[K+1], T[K+2], .. . ). Although the clock 910 may be common to (and therefore shared by)all log event producers on a particular cache server, there is norequirement that a shared clock be used.

A log event router 912 (in the log event producer 902′) filters androutes log events to one or more currently active log streams. Thus, asshown in the drawing in FIG. 7-B, log event router 912 filters androutes the log events 908 to one or more log streams. In the exampleshown, the log events 908 are filtered and routed asp sets of log events(p≧1, denoted 908-1, 908-2 . . . 908-p). It should be appreciated thatany particular log event from the log events 908 may be routed to morethan one log stream.

FIG. 7-C shows a log stream 904. The log stream takes as input one ormore time ordered sequences of log events from one or more log eventproducers, sorts and accumulates these log events, and produces asequence of log records.

Preferred implementations make and rely on the following assumptions:

-   -   different vcores may (and likely will) have distinct,        unsynchronized clocks;    -   each log stream is aware of the existence of all log producers        which could send it events;    -   the “correct” order in a stream is defined by the timestamps,        regardless of what vcore determined the timestamp and what the        correspondence is between that vcore's clock and real/actual        time;    -   for the events coming from a particular log event producer, the        relative order in which events are received at a stream is the        same as the relative order with which they were emitted by the        producer;    -   producers may emit events in batches of arbitrary size, and in        any time order (subject to one additional constraint described        below).

In some implementations, each stream could be wrapped in an envelopethat authenticated/identified the sender—rather than relying on knowingof all of them a priori.

No assumptions are made about the relative timestamp order of eventsreceived from different log event producers.

The one additional constraint is that periodically there must be atime-stamped marker event that is emitted by each log event producer(i.e. typically by each individual vcore), and the producer mustguarantee that the timestamps of all subsequently emitted events will begreater than the timestamp of the marker. This constraint is consideredtrivial for a single vcore to guarantee. The timestamps of eventsbetween markers can be in arbitrary order, provided they are bounded bythe markers on either side.

With these assumptions, the events received at the input to a log streammust be assumed to be out of order, even when considering the eventsfrom a single producer. To deal with this the system adopts an approachsimilar to that used in distributed discrete event simulations.

With this guarantee, each log stream S_(i) can independently maintain amaximum processed timestamp Tmax_(p) for each event producer p, and usethis to compute its own local version of global time Tg_(Si) by takingthe minimum:

Tg _(Si)=min({Tmax_(p) |∀p∈Producers})

Then the stream may periodically process (order) all events receivedwith timestamps less than or equal to Tg_(Si), since it will beguaranteed that it will not receive any further events with timestampsless than or equal to Tg_(Si).

With reference to FIG. 7-C, sorting and accumulation mechanism 914generates log records 916 from log events input to the log stream 904.The log records 916 produced by a log stream 904 may be stored locallyon the CDN component. In addition, the log records 916 produced by a logstream 904 may be treated or considered to be one or more streamingfiles 920. Such files may be provided (e.g., pushed) as event streams toone or more reducers (and possible collectors) in the CDN. If theproducers produce events in time order (as far as they are concerned),then this may be implemented using merging instead of sorting.

At any given time a CDN component is able to generate a predeterminedset of log file types appropriate for that type of component. A log filetype defines the general structure of a log file in terms of the logevents that are in the scope of the log file and the rows and columns ofdata that may be included in an instance of that file type. There willgenerally be a unique code that must be designed into the CDN componentin advance for each supported base type, and the base type willdetermine the set of configuration options that are applicable and thelogical structure of the generated log records (though not theirconcrete format).

A log file type is a combination of a log file base type and associatedparameter settings. It completely determines the logical content andstructure of the output log record stream for a given input eventstream.

Each base type may expect certain parameters to be set (or not) in orderto configure the specific behavior of the type. Some parameters mayapply to most/all types, some may be specific to specific types.

A filter is a parameter that defines the criteria that must be satisfiedby the log events that are to be dispatched to the log file.

A selection is a parameter that defines the attributes of the includedevents that are to be included in the log file.

A log file instance is an actual log file—a particular set of datagenerated over some time interval according to a chosen log file typeand style. A log file may be, e.g., streamed or on disk In the case ofstored log files, a log file may be a current log file (still activelybeing appended to) or a rotated log file (no longer being appended to).

A log stream is an active entity that produces a related set of log fileinstances corresponding to a particular log file type and style.

A logging configuration of a CDN component is a definition of a set oflog streams for that component. Each stream conceptually “listens” forcertain events, selects the events and fields it cares about,time-orders the events received from different producers, and formatsthe stream according to the selected style to generate log fileinstances, rotating files as indicated by the file type.

Each stream preferably has an identifier (a symbolic name) that isuseful, e.g., for debugging and also as the means to associate loggingconfiguration changes which existing streams.

As should be apparent from the description, the measurement and logevent generation mechanisms are separated and upstream from the logstreams. They construct log events and forward them to an event router,with no required knowledge of what happens downstream (i.e., with norequired knowledge of what log streams exist, what events matter to whatlog streams, or how log files will be formatted). In some cases,knowledge of what the log streams are may be made available to the logevent generation mechanisms for performance reasons.

Log event routers are similarly oblivious of the upstream and downstreambehaviors, other than basic knowledge of what log streams exist andwhich events go to which streams. Log streams consume events that havebeen directed to them, but they have (and need) no knowledge of whatgenerated the events and minimal knowledge of the nature of each eventsource. Log streams are responsible for time ordering, item selection,item accumulation, formatting, etc.

The logical structure of a type of log files (in terms of the sequentialor hierarchical structure of records they contain, etc.) is decoupledfrom the syntactic style with which log record content is represented ondisk, allowing pluggable log file styles.

It should be appreciated, however, that log files records should containsufficient information to identify the origin of each record. In somecases, records should include an identification of the CDN componentthat generated the record. In some cases, log file records shouldinclude an identification of the sub-CDN in which the record wasproduced. A collector in the sub-CDN may add information to a record aspart of its reduce functionality in order to add sub-CDN identificationinformation. In this manner, log file records may propagate through asub-CDN without any such identification information, and may be added bya collector as the records leave the sub-CDN and are passed to theshared CDN components.

Reducers and Collectors

A reducer service (or reducer or data reducer) is a service thatconsumes, as input, one or more event streams (along with control and/orstate information) and produces, as output, one or more event streams(along, possibly, with control and/or state information). As notedelsewhere, a reducer need not actually reduce the size of any inputevent stream. The network of reducers in a CDN may be referred to as anetwork of data reducers or NDR. The reducer services 1016 (FIGS. 1-L,1-O) may be considered to be an NDR. In preferred implementations eachreducer in the NDR is an event stream processing engine with essentiallyno long-term state. A CDN comprises multiple reducers forming one ormore NDRs.

Each reducer (reducer service) 107 may take in one or more input streamsand produce one or more output streams. As shown in FIG. 8-A, eachreducer 107 comprises one or more filters 802 to process the collector'sinput stream(s) and produce the collector's output stream(s). As shownin the drawing, the reducer 107 reduces the m input streams (m≧1) to noutput streams (n≧1). It should be appreciated that the value of n (thenumber of output streams) may be greater than, equal to, or less thanthe value of m (the number of input streams). In other words, the numberof output streams may be greater than, equal to, or less than the numberof input streams.

Although the term “reducer” is used herein to describe the mechanism, itshould be appreciated that a particular reducer may not actuallydecrease the size of the output stream streams relative to the inputstreams. A reducer may be, e.g., a consolidator, a combiner, apass-through mechanism, a splitter, a filter, or any combination ofthese with other mechanisms that act on the one or more input streams toproduce a corresponding one or more output streams. Thus, a reducer mayact, e.g., to reduce an input stream into multiple output streams. Asanother example, a reducer may reduce multiple input streams into asingle output stream. The various mechanisms that comprise the filters802 in a reducer may operate in series and parallel or combinationthereof, as appropriate.

Although, as noted, each reducer may receive multiple input streams.These input streams to a reducer need not be of the same type, and areducer may be configured to process multiple different kinds of inputstreams. It should also be appreciated that the one or more of outputstreams may be the same type as one or more of the input streams.

The input streams to a reducer 107 may come from one or more other CDNservices, including, without limitation, from other caching services,other rendezvous services, other collector services, and other reducerservices.

It should be appreciated that a reducer 107 (e.g., as shown in FIG. 8-A)is a CDN service and, as such, may (in addition to event streams) takeas input control and state information. As shown in FIG. 1-E (and FIGS.1-L, 1-O), a reducer service may obtain event streams from otherreducers, from collectors, from control mechanisms, from configurationservices and from other services. In addition, a reducer service (e.g.,reducer 107 in FIG. 8-A) may obtain control information (C) from thecontrol mechanism(s) and state information from the collectors.

FIG. 8-B shows an exemplary reducer in which multiple CDN components (orservices) each produce an event stream (each denoted Sx) that is inputinto the reducer 107-x. One or more filters in the reducer 107-x producethe stream Sx′ from the multiple input streams Sx. The stream Sx′ outputby the reducer 107-x may be, e.g., a time ordered combination of theevents in the multiple input streams Sx. In the example in FIG. 8-B, thereducer 107-x reduces the m input streams (of the same type) to onesingle output stream.

Those of ordinary skill in the art will realize and understand, uponreading this description, that each of the multiple CDN components orservices may be any component in the CDN including, e.g., a cache, acollector, a reducer, a rendezvous mechanism, the control mechanismcomponent, etc. It should be understood that the multiple CDN componentsproviding streams of data to a particular reducer need not all of thesame type.

The reducers operating on a particular stream or type of stream mayoperate in series, each producing an output stream based on one or moreinput streams. For example, as shown in FIG. 8-C, a particular CDNcomponent or service produces k event streams (denoted S1, S2 . . . Sk).The CDN component provides (e.g., pushes) each of k streams to at leastone reducer. As shown in the drawing, stream S1 is provided to reducer107-1, stream S2 is provided to reducer 107-2, and so on. Reducer 107-1reduces the input stream S1 (along with its other inputs) to produce anoutput stream S1′. Stream S1′ is provided (e.g., pushed) to reducer107-1,1 which reduces that stream (along with its other inputs) toproduce output stream S″, and so on. Eventually reducer 106-7,m producesoutput stream S″″. Similar processing takes place for each of the otherstreams produced by the CDN component. Those of ordinary skill in theart will realize and understand, upon reading this description, that notevery type of stream requires the same number of reducers operating inseries to reduce it to the required output stream. It should beappreciated that each reducer shown in FIG. 8-C may process multipleinput streams (not shown in the drawing).

When operating in series (e.g., as with the reducers in FIG. 8-C), thefilter function of the series of reducers is effectively a combinationof filter functions of each of the reducers, in order. For example, withreference to FIGS. 8-C to 8-D, if the series of reducers 107-2, 102-2,1. . . 107-2,n implement filters F1, F2 . . . Fn, respectively, on theinput stream S2, then the series of reducers effectively implements thefilter Fn(Fn−1( . . . F2(F1 (S2)) . . . ).

The series of reducers that operate to produce a particular outputstream from one or more input streams may be located or organized in thesame cache hierarchy as the caches. Thus, e.g., there may be, forcertain streams, reducers in each tier that reduce and/or consolidateevent streams from their own tier. These consolidated or reduced streamsmay then be provided, e.g., pushed, to a reducer in a lower tier in thehierarchy. As noted above, however, the reducers may form a network witha topology or structure different from that of the other services.

Each entity that produces and/or consumes events or event streams isgenerally referred to as an agent. Thus, as used herein, an agent is aprocess that is producing or consuming events or event streams. A givenmachine on the network could have more than one agent, and a given agentcould be performing multiple responsibilities (producing and consumingevents, storing reduced versions of events, and providing value addedservices based on the history of events it has processed).

A reducer is essentially an agent that computes output event streamsfrom input event streams. Generally, the volume of events in the outputstreams is reduced in comparison to the input volume, though this is notstrictly necessary. The reduction process tends to group events based ontheir spatio-temporal attributes and accumulate their other values insome other reduction specific way.

As noted above, each CDN component may produce one or more event streamswhich can be obtained by other CDN components (e.g., via reducers 107and/or collectors 106). FIG. 9-A shows an exemplary CDN component, acache, producing K streams of data and providing each of those streamsas an event stream, via reducers, to an appropriate collector. Thereducers reduce the streams, as appropriate, and provide theirrespective output stream(s) to other collectors. For example, as shownin the drawing in FIG. 9-A, the data produced by stream #1 is providedas event data to the reducer(s) 107-1 which in turn provide some or allof the data (having been appropriately reduced) to two collectors. Inthis example, it is assumed that stream #1 produces event data relatingto content pulls from the cache. These data may be used, e.g., toproduce billing information as well as to collect information about thepopularity of requested resources. Accordingly, in this example, thedata relating to content pulls is sent (e.g., pushed) via reducer(s)107-1 to collectors that will transform it to the appropriate billinginformation logs which are provided to appropriate mechanisms in the OMAsystem 109 (FIG. 4-B). Similarly, the data produced by stream #2 areprovided (e.g., pushed) via reducer(s) 107-2 through a series ofcollectors. In this example, is assumed that the data produced by stream#2 relates to load information about the cache. This load informationmay be used, e.g., by the rendezvous system in order to select cachesfor resource requests.

Similarly, the data produced by stream #k are provided (e.g., pushed)via reducer(s) 107-k through a series of collectors. In this example, itis assumed that the data produced by log stream #k relate to healthinformation about the cache. This health information may be used, e.g.,by the rendezvous system in order to select caches for resource requestsand by the control mechanism to maintain configuration information aboutthe CDN.

FIG. 9-B shows an exemplary rendezvous mechanism/service (e.g. DNSserver) producing M streams of log data and providing each of thosestreams via reducer(s) to appropriate collector(s).

Although shown as separate elements in the drawings, the reducer(s)denoted 107-1, 107-2 . . . 107-k in FIG. 9-A may overlap or be the samereducer(s), as may the reducer(s) denoted 107-1, 107-2 . . . 107-m inFIG. 9-B. The reducer(s) denoted 107-i in FIGS. 9-A to 9-B may beconsidered to be sets of reducers in the reducer network, and the setsmay overlap.

It should be appreciated that the log streams and collectors describedin the previous examples are given only by way of explanation, and arenot intended to limit the scope of a system in any way. Log dataproduced by caches and rendezvous mechanisms and any other CDN componentmay include data that can be used, e.g., for billing, load assessment,health assessment, popularity measurement, status checking, etc. Theselog data may be used to provide information to other CDN componentsincluding the rendezvous mechanisms, the control mechanism, and variousadministrative mechanisms (e.g., for billing).

By monitoring log data from CDN components, the control mechanism isable to maintain a near real-time view of the health and load of theCDN, down to the resolution of a single component. In addition, log datafrom the CDN components may be used to provide near real-timeinformation about demand for particular properties (which can be used todetermine the popularity or relative popularity of various properties).Popularity information may be used, e.g., by the rendezvous mechanism,to pre-fill caches, and to reconfigure components of the CDN.

Log-Less Request Logging

The logging system allows for log-less request logging. Specifically,using the logging system provided by the reducer/collector services,there is no need for caches or other CDN services or components to storelog files locally. Instead of (or as well as) the processing of arequest by a cache resulting in generating an entry in a log file, foreach entry (e.g., request) in a log file the cache may emit an eventwith all the same information to a log stream. Each log stream would beconsumed, preferably by at least two reducer nodes whose output wouldeventually be merged together, resulting in reliable delivery of requestevents to interested consumers (e.g., analytics engines, request loggenerators, even subscriber applications). Those of ordinary skill inthe art will realize and understand, upon reading this description, thata single reducer node could be used for each log stream, but themultiple reducer nodes provide additional reliability in case one of thereducer nodes fails.

Reducer and Collector Redundancy

Since it is assumed that event information may not be stored locally ona physical machine associated with a service instance, service instancesin the CDN are preferably assigned at least two reducers to which tosend their events. Reducers can feed other reducers, in hierarchicalfashion. Thus, e.g., as shown in FIG. 10-A, the CDN service instances inclusters C0 and C1 each provide their event streams to both reducer R0and reducer R1. Thus, if either one of the reducers fails, the eventstreams from the service instances will still be captured. FIG. 10-Bshows an exemplary configuration in which event streams from sixclusters or service instances (denoted C0, C1, C2, C3, C4, C5) are eachsent to two reducers (out of six reducers R0 to R5). Thus, event streamsfrom cluster C0 are provided to reducers R5 and R0, event streams fromcluster C1 are provided to reducers R0 and R1, and so on.

As noted, a reducer could be a local agent on the same machine as theservice instance, or a remote agent. A local reducer may be used with alocal collector to store information locally.

FIG. 10-C shows another exemplary configuration in which the reducersare logically organized in an hierarchical manner, with reducers inmultiple levels. As shown in the drawing, service instances in eachcluster provide their event streams to two reducers in the first level(Level 0). The service instances in cluster C1 provide their eventstreams to reducers L0R0 and L0R1, the service instances in cluster C2provide their event streams to reducers L0R1 and L0R2, and so on. Thereducers in Level 0 of the reducer hierarchy each provide event streamsto two reducers at the next level in the hierarchy (in this example, toreducers L1R0 and L1R1), and so on.

FIG. 10-D shows an exemplary hierarchical configuration of reducers (oran NDR) in which the reducers are organized hierarchically (in levels)and by geographic region, with groups of reducers for North America(NA0, NA1), Latin America (LA0, LA1), Europe (EU0, EU1), and the AsiaPacific region (AP0, AP1). Service instances in the CDN will providetheir event streams to appropriate reducers based on their regions. Thefirst level reducers then provide their event streams to reducers at thenext level (NALA0, NALA1, EUAP0, EUAP1), and so on. At a third level,the event streams are provided to reducers in groups G0 and G1. Itshould be appreciated that each of the circles in the diagram in FIG.10-D may represent a single reducer or a group of reducers. Thus, e.g.,the circle labeled LA0 may be a single reducer or it may comprisemultiple reducers. Similarly for each of the other circles in thediagram.

It should be appreciated that the instances or clusters of serviceinstances shown in the diagrams may be any kind of service instance.

As noted earlier, with reference to FIG. 1-L (and FIG. 1-O), the reducerservice instances may form a network (NDR), a reducer services networkcomprising one or more sub-networks of those reducers. Varioustopologies and configurations of the reducer service instances networkand sub-networks are shown here, although it should further beappreciated that the configurations shown in FIGS. 10-A to 10-D areprovided by way of example, and that different and/or otherconfigurations may be used within a CDN. In addition, the configurationand/or topology of the network(s) of reducer service instances may bedynamic and may change during operation of the CDN. For example, the NDRor part thereof may change based on control information provided tovarious service nodes. This control information may have been determinedbased, at least in part, on feedback from service nodes in the CDN,provided to the control system via the NDR and the collectors.

As noted, a service instance may produce multiple different eventstreams, each relating to different kinds of events. Those of ordinaryskill in the art will realize and understand, upon reading thisdescription, that a service endpoint may provide different event streamsto different reducers. Furthermore, those of ordinary skill in the artwill realize and understand, upon reading this description, thatdifferent degrees of redundancy may be used for different event streams.It should be understood that each reducer produces at least one outputevent stream based on its operation as a CD service.

As described here, a service or component provides event data to anotherservice or component (e.g., to a reducer or a collector). Event data maybe provided by being pushed to the recipient component(s). Preferablythe recipient of an event stream from a source is aware of the identityof that source, and preferably some form of authentication is used toauthenticate the sender of the event stream.

Redundant duplicate collectors may also be provided, in a similar mannerto reducers, to avoid lost data.

FIG. 10-E shows an exemplary machine 300 running k services 308 (denotedS0 . . . Sk). Each service Sj on the machine provides its events to acorresponding set of reducers 107-Sj in the reducer services network1016. It should be appreciated that the sets of reducers 107-Sj may bedistinct, although some or all of the sets of reducers 107-Sj mayoverlap. Thus, e.g., the reducers in the set of reducers 107-Sp may becompletely distinct from those in the set of reducers 107-Sq, for eachp, q∈[0 . . . k], or some or all of the sets of reducers 107-Sp mayoverlap (i.e., be the same as) those in the set of reducers 107-Sq, forat least some p, q∈[0 . . . k].

Reducer and Collector Implementations

This section provides generic implementation models of reduction andcollection and then provides examples of reducers and collectors,showing first how they are specified in terms of the genericimplementation models.

The generic implementation models are useful for understanding andimplementing reducers and collectors. In presently preferredimplementations, generic reducers and generic collectors are provided,whilst specific reducer and collector specifications are deployed to thegeneric engines via their configurations. It should be appreciated thatthese specifications may be just service configurations that may changedynamically, as with all services.

A pure reducer is a service that consumes input events and generates astream of reduced output events, where the output events generallysummarize the input events by aggregating over space and time. Purereducers do not store anything more than they need to buffer in order tocompute their output events, and they provide no queries over eventsthey may have read or generated—they just generate events as theycompute them.

A pure collector, on the other hand, consumes input events andaggregates them into one or more tables which can be queried ad hoc, butpure collectors produce no output events (other than the event streamsthat they produce as CD services, e.g., event streams relating tohealth, utilization, activity, etc.).

Although only pure reducers and collectors are described here, those ofordinary skill in the art will realize and understand, upon reading thisdescription, that there is nothing that should prevent an actual serviceimplementation (and perhaps even the generic reducer/collector engine)from combining the facilities for reduction and collection.

Generic Reducer

A generic reducer R consumes one infinite event stream e and generatesanother infinite event stream E in real time:

$e\text{:}{{\langle{e_{0},e_{1},\ldots}\rangle}\overset{R}{}E}\text{:}{\langle{E_{0},E_{1},\ldots}\rangle}$

Each event e_(i) or E_(j) is assumed to be an arbitrarily long tuple ofthree kinds of components: a timestamp, a set of keys, and a set ofvalues. Those of ordinary skill in the art will realize and understand,upon reading this description, that in implementations there may beother tuples for stream identifiers, agent identifiers, etc.

e _(i)=(t _(i) ,{right arrow over (k)} _(i) ,{right arrow over (v)}_(i))=t _(i) ,k _(i0) , . . . ,k _(im) ,v _(i0) , . . . ,v _(in))

E _(j)=(T _(j) ,{right arrow over (K)} _(j) ,{right arrow over (V)}_(j))=(T _(j) ,K _(j0) , . . . ,K _(jp) ,V _(j0) , . . . ,V _(jq))

The actual content of events and ordering of tuple components may bearbitrary, and relies on a function project to define the inputprojection and a function compose to define the output composition:

(t _(i) ,{right arrow over (k)} _(i) ,{right arrow over (v)}_(i))=project(e _(i))

E _(j)=compose(T _(j) ,{right arrow over (K)} _(j) ,{right arrow over(V)} _(j))

Input events t_(i) are consumed in timestamp order and output events aregenerated with monotonically increasing timestamps T_(j) and withbounded delay (hence the “real-time” claim). It is possible to have manyevents in the input stream with the same timestamp, and many events inthe output stream with the same timestamp. The resolution of T_(j) mustbe less than or equal to the resolution of t_(i). A generic reducer isfurther defined by two Boolean filtering functions:

receive?(t _(i) ,{right arrow over (k)} _(i) ,{right arrow over (v)}_(i))

send?(T _(j) ,{right arrow over (K)} _(j) ,{right arrow over (V)} _(j))

These two functions determine which input events will be consumed andwhich output events will be sent. The following four key/valuetransformation functions complete the definition of the reducer:

T _(j)=warp(t _(i))

{right arrow over (K)} _(j)=map({right arrow over (k)} _(i))

({right arrow over (V)} _(j))₀=init(T _(j))

({right arrow over (V)} _(j))_(i+1)=reduce(({right arrow over (V)}_(j))_(i) ,{right arrow over (v)} _(i))

where warp defines how high resolution input timestamps are aggregatedinto lower resolution output timestamps, map defines how input keys mapto output keys, and the two functions init and reduce define anincremental folding of input values into aggregated output values. Thisis in effect a standard map/reduce computation, but appliedincrementally in time-sequenced manner as opposed to a batch computationon previously collected data.

Note that the input and output timestamps could have equivalently beendefined as part of the keys, but they were explicitly separated becausethey defined the buffering behavior of the reducer. Output events for agiven output timestamp are generated in order, at some point after thepoint where all relevant input events for that output timestamp havebeen consumed.

Algorithm 1 Generic Reduction Procedure INPUT(e)  (t,{right arrow over(k)},{right arrow over (v)}) ← project(e)  If receive?(t,{right arrowover (k)},{right arrow over (v)}) then   consume(t,{right arrow over(k)},{right arrow over (v)})  end if End procedure INPUT ProcedureCONSUME(t,{right arrow over (k)},{right arrow over (v)})  T ← warp(t) {right arrow over (M)} ← map({right arrow over (k)})  {right arrow over(A)} ← accum{T,{right arrow over (M)}}  If undefined {right arrow over(A)} then   {right arrow over (A)} ← accum{T,{right arrow over (M)}} ←init(T)  end if  accum{T,{right arrow over (M)}} ← reduce({right arrowover (A)},{right arrow over (v)}) End procedure CONSUME ProcedurePRODUCE(T,{right arrow over (K)},{right arrow over (V)})  Ifsend?(T,{right arrow over (K)},{right arrow over (V)}) then   E =compose(T,{right arrow over (K)},{right arrow over (V)})   OUTPUT( E ) end if end procedure PRODUCE

The reducer maintains an input clock representing the last inputtimestamp for which all input events have been consumed. Theimplementation of the event transport provides a mechanism for an eventsource to guarantee to an event sink that events earlier that a giventimestamp will no longer be generated, and this mechanism is used toadvance the reducer's clock. Whenever the input clock advances fromt_(i) to t_(i+1) the output clock may also need to advance, depending onwhether warp(t_(i))=warp(t_(i+1)). If the output clock advances, thereducer may generate all reduced values collected for all outputtimestamps up to but not including warp(t_(i+1)).

Generic Collector

A generic collector C consumes an event stream and generates updates toa table, while asynchronously responding to ad hoc queries over thetable:

$e\text{:}{{\langle{e_{0},e_{1},\ldots}\rangle}\overset{C}{}{Table}}{\text{:}\left\lbrack {{Col}_{0},{Col}_{1},\ldots} \right\rbrack}$

The collector's TABLE is specified in the collector as a set of columns,and a key function defines how to compute the key used to lookup a rowin the table from a given input event (usually as a projection of eachinput event).

Input events are just like the inputs to reducers, and are consumed intimestamp order. The key corresponding to each input event determines arow which may or may not already exist. The specifications of update?and/or update functions determine when, where, and how updates occur:

-   -   If update?(e) is true, the event should cause an update        (otherwise the event is ignored).    -   If the row for key(e) exists in the table, then update(e, row)        returns the new value to store in that row.    -   If the row for key(e) does not exist in the table, then        update(e) returns the initial value for a new row.

Periodic updates to the table may also be defined to occurasynchronously with the event stream (where the period is aconfiguration parameter). In this case, conditions are defined onexisting rows without regard to events, and rows are updated or deletedif those conditions are true:

-   -   When update?(row) is true, the row's new value is set to        update(row).    -   When delete?(row) is true, the row is deleted.

Pseudo columns may be defined to represent the ordering of a row withrespect to the sort order imposed by a particular column (and possiblyother values that are computed periodically based on the overall tablestate). The value of this column may then be used to filter out rowspast a certain position in the sort order in order to implement a top-Nretention policy. Other aggregate values computed over multiple rows maybe referenced in selectors. (Pseudo columns and aggregate values canalso be implemented via separate event streams, though less convenientlyso.)

As should be apparent to those of ordinary skill in the art, uponreading this description, collectors and reducers consume the same kindof event streams in accordance with an embodiment. As a consequence, notevery collector will need intervening reducers in order to consume andprocess event streams.

Collectors and the Operation/Measurement/Administration (OMA) System

A Network Data Reducer (NDR) generally refers to the system of reducersacross the global CDN, including not just the individual stream reducersbut also the entire system for configuring and deploying the reducers tovarious places in the network. Preferably the NDR does not actuallystore anything for any length of time, it just makes data streamsavailable to processes.

Reducers thus provide event streams (possibly via other reducers in anNDR) to collector services (or collectors). Collectors are aheterogeneous collection of services that transform reduced eventstreams into useful services, possibly storing large amounts ofhistorical state to do so.

The Network Data Collector (NDC) refers to the set of processes thatconsume events and store them in some way in order to provide additionalnon-event-stream services to other parts of the network. As described,certain of the event consuming applications may also provide feedbackservices (possibly even source additional events).

With reference to FIGS. 1-L and 11, the reducer services 1016 comprisean NDR, and the collector services 1012 comprise an NDC.

The reducer/collector services may provide a source of local or globaldata (e.g., in real time) for analytics, monitoring, and performanceoptimization. Data are detected, reduced, and preferably used as closeto the source as necessary. Aggregation over multiple nodes in aneighborhood means nodes can get near real-time access to informationthat is not directly computable from purely node-local information.

The use of event streams, in conjunction with appropriate reducer andcollector services means that CDN service endpoints, e.g., caches, DNSname servers, and the like, need not create or store local loginformation. Information that may be needed globally (e.g., forfeedback, control, optimization, billing, tracking, etc.) can beprovided in real time to other services that need (or may need) thatinformation. It should be appreciated that the use of event streams,reducers and collectors does not preclude the local storage of loginformation at event generators, although such storage is generally notrequired.

Certain event data, however, may be more important than other event data(e.g., event data that may be used for accounting or billing purposes),and such data, referred to here as precious data, may be stored locallyat its source as well as sent as an event stream to the NDR. Those ofordinary skill in the art will realize and understand, upon reading thisdescription, that the reducer(s) to which a service sends an eventstream could include a local agent on their machine, or a remote agent.Similarly, a collector service may be a local service/agent. Thus, aservice may use a local reducer, alone or with a local collector, ontheir machine, to create local log data related to the local eventstream.

Each collector may provide some or all of one or more of the servicesassociated with the OMA 109 (FIG. 4-B). Thus a collector service may beused as one or more of: a monitor and gatherer 120, a measurer 122, ananalyzer 124, a reporter 126, a generator 128, and an administrator 130.That is, a collector service may use the input stream(s) (eventstream(s)) obtained from one or more reducers to provide, in whole or inpart, services associated with the OMA.

For the purposes of this description, a collector providing a particularOMA service may be referred to by the description of that OMA services.For example, a collector 106 providing service as a load analyzer 142may be referred to as a load analyzer 142 or a load analyzer collector,etc. Those of ordinary skill in the art will realize and understand,upon reading this description, that a particular collector may providemultiple OMA services or functionality. Thus, it should be appreciatedthat a collector may combine the functionality of various aspects of theOMA. For instance, gathering, measuring, analyzing and reporting may allbe combined into a single collector.

Various examples of uses of the reducer/collector system (the NDR andNDC) are provided here. Some of these examples show implementation ofreducers and/or collectors using the generic/pure reducer/collectorsdescribed above. In the following description, reducers shown witharguments T, L, C, and/or A actually represent families of multiplereducers, where a single reducer in the family is defined by theselection of the function parameters T, L, C, and/or A.

The reducers covered here are listed in Table 3.

TABLE 3 Reducers Reducer Name Input Event Output Event 1 RequestCounter 

(t, l, c, r, s) (T, L, C, r, s, N) 2 Usage 

(t, l, c, r, s, N) (T, L, C, N, B) 3 Billing 

(t, l, c, {right arrow over (r)}u) (T, L, C, {right arrow over (R)}U) 4Load 

(t, l, {right arrow over (m)}) (T, L, {right arrow over (M)}) 5Analytics 

(t, l, c, r, N) (T, L, C, A, N)

Example Reducer 1: Basic Request Counting

This reducer merely counts requests, producing an output event streamcontaining the resource size and total request count per output timeinterval T for each unique resource observed, where t is the cachesystem clock when resource r of size s was requested from cachinglocation l and processed according to request collection c.

Reducer 1: RequestCounter(T,L,C) Input: (t,l,c,r,s) Output:(T,L,C,r,s,N) warp (t) ≡ T(t) key(t,l,c,r,s,e,h) ≡ (l,c,r) map(l,c,r) ≡(L(l),C(c),r) value(t,l,c,r,s) ≡ (s,1) = (s,N) init(t) ≡ (0,0)reduce((s₁,an),(s₂,n)) ≡ (s₂,an + n)

Thus the output stream will contain one event

$\left( {T,L,C,r,s,{N = {\sum\limits_{L,C,r,{t \in T}}^{\;}\; 1}}} \right)$

for each unique value of (L, C, r) per minute T , where s is the mostrecently received size value.

Example Reducer 2: Throughput and Bandwidth Usage

To compute throughput and bandwidth consumption, sum the product ofrequest counts and resource sizes.

Reducer 2 Usage(T,L,C) Input: (t,l,c,r,s,N) Output: (T,L,C,N,B) warp(T)≡ T(t) key(t,l,c,r,s,N) ≡ (l,c) map(l,c) ≡ (L(l),C(c))value(t,l,c,r,s,N) ≡ (N,N * s) = (N,B) init(T) ≡ (0,0)reduce((an,ab),(n,b)) ≡ (an + n,ab + b)

Example Reducer 3: Billing

To compute billing information sum resource utilization counts.

Reducer 3 Billing(T,L,C) Input: (t,l,c,{right arrow over (r)}u) Output:(T,L,C,{right arrow over (R)}U) warp(T) ≡ T(t) key(t,l,c,{right arrowover (r)}u) ≡ (l,c) map(l,c) ≡ (L(l),C(c)) value(t,l,c,{right arrow over(r)}u) ≡ ({right arrow over (r)}u) = ({right arrow over (R)}U) init(T) ≡({right arrow over (0)}) reduce(({right arrow over (a)}n),({right arrowover (n)})) ≡ ({right arrow over (a)}n + {right arrow over (n)})

Example Reducer 4: Load

To perform load monitoring, compute average load metrics. In this caseassume {right arrow over (m)} consists of a set of additive metrics atsome measurement location l , and all locations in the input stream areequally weighted. For example, a metric might be CPU utilization andlocations could refer to different machines with the same number ofcores each. The average load per location can then be computed from eachoutput event by {right arrow over (M)}/N.

Reducer 4 Load(T,L) Input: (t,l,{right arrow over (m)}) Output:(T,L,{right arrow over (M)},N) warp(T) ≡ T(t) key(t,l,{right arrow over(m)}) ≡ (l) map(l) ≡ (L(l)) value(t,l,{right arrow over (m)}) ≡ ({rightarrow over (m)},1) = ({right arrow over (M)},N) init(T) ≡ ({right arrowover (0)},0) reduce(({right arrow over (a)}m,an),({right arrow over(m)},n)) ≡ ({right arrow over (a)}m + {right arrow over (m)},an + n)

Example Reducer 5: Analytics

To compute analytics sum request counts by resource groups.

Reducer 5 Analytics(T,L,C,A) Input: (t,l,c,r,N) Output: (T,L,C,A,N)warp(T) ≡ T(t) key(t,l,c,r,N) ≡ (l,c,r) map(l,c,r) ≡ (L(l),C(c),A(r))value(t,l,c,r,N) ≡ (N) init(T) ≡ (0) reduce((an),(n)) ≡ (an + n)

Collectors

The example collectors described here are listed in Table 4.

TABLE 4 example collectors Collector Name Input Event Output Table 1CacheIndex (t, node, r, cached) CacheIndex(node, r, cached) 2 TopN (t,r, N) TopN(r, N, rank) 3 UpTime (t, x, a) UpTime(x, a, first, last, ust,dst, utot) 4 Popularity (t, r, ca, sz, rate) Popularity(r, t, ca, sz,rate, rank)

Collector 1: A Caching Index Collector

A collector may be used to track where each resource is cached fromamong a set of caches. From each cache consume a variant of the requeststream including events from the asynchronous cache management part ofeach cache, in effect receiving a sequence of events telling us whenresources are added to or removed from a given cache's in-memory oron-disk cache.

To simplify the discussion, assume each cache just has an in-memorycache. A fill inserts a resource into cache, an eviction or purgedeletes it from cache. In this version, invalidation does not changeanything (though this could easily be extended to index cached resourcesby minimum origin version). Given an input stream of events:

(t,node,r,cached)

this collector (see collector CacheIndex below) retains rows of the form(node, r, cached), where cached=1 means that node has a copy of r incache. The collection is defined such that (node, r) is a key, so each(node, r) combination has one value of cached representing the lateststate of node's cache with respect to resource r.

Collector 1 CacheIndex Input: (t,node,r,cached) Table: CacheIndexcolumns ≡ (node,r,cached) key ≡ (node,r) update?(e) ≡ true delete?(row)≡ (row.cached == 0)

This updates with a new cached value for each event, then deletes rowsfor resources which are not cached.

Collector 2: Top-N Request Collector

Given a request count event stream, a collector may be defined (seecollector 2—TopN) that captures the most popular resources over someamount of time in the recent past, and then allows the captured data tobe queried.

Collector 2 TopN Input: (t,r,count) Table: TopN columns ≡ (r,count,rank: sort(count)) key ≡ (r) update?(e) ≡ true delete?(row) ≡ (row.rank > N)

This inserts every event, projecting just the (r, count) fields andadding a rank column, and then deletes rows with insufficient rank.

Collector 3: Uptime Collector

An uptime collector captures events indicating the availability a∈{0,1}of entity x at time t:

(t,x,a)

where a=0 if the entity (machine, service, VIP, etc.) is unavailable,a=1 if it is available, and use this information to compute the totaltime the entity has been available. Such a collector is shown incollector 3 (Uptime), which maintains for each entity x the lastavailability value a along with the first and last time any event wasreceived for a given entity, the last time the entity went from down toup (ust=up start time), the last time the entity went from up to down(dst=down start time), and the total uptime and downtime (utot anddtot). Total downtime can be computed from (last−first)−utot.

Collector 3 Uptime Input: (t,x,a) Table: UpTime columns ≡(x,a,first,last,ust,dst,utot) key ≡ (x) update?(e) ≡ true update(e) ≡(e.x,e.a,e.t,e.t,e.t,e.t,0) update(e,r) ≡ case e.a > r.a →(r.x,1,r.first,e.t,e.t,r.dst,r.utot) e.a < r.a →(r.x,0,r.first,e.t,r.ust,e.t,r.utot + (e.t − r.last)) e.a = 1 →(r.x,1,r.first,e.t,r.ust,r.dst,r.utot + (e.t − r.last)) e.a = 0 →(r.x,0,r.first,e.t,r.ust,r.dst,r.utot) update?(r) ≡ (r.a = 1) andage(r.last) > MaxAge₁ update(r) ≡ update(r,(now,r.x,0)) delete?(r) ≡(r.a = 0) and age(r.last) > MaxAge₂

The last part of this collector deals with entries in the collection forwhich no new information has been received. It the current state isdeclared up and the time since the last received event is greater thanMaxAge₁ then the entity is declared down at that time. If an entity hasbeen declared down and the time since the last received event (or thetime it was assumed down) is greater than MaxAge₂ then the entity isdeleted from the collection.

Collector 4: Resource Popularity, Cacheability, and Size Collector

A collector may be used to keep track of the popularity, cacheability,and size of a resource in order to inform the peering policy of a set ofpeer caches from an event stream of the form:

(t,r,ca,size,rate)

where r is a resource identifier, ca ∈[0,1] is the cacheability of theresource (where 0 means non-cacheable and 1 is maximally cacheable),size is the number of bytes in the response, and rate is theinstantaneous request rate (as measured by the reducer producing thisevent stream, which would be averaged over some time period).

Collector 4 Popularity Input: (t,r,ca,size,rate) Table: Popularitycolumns ≡ (r,t,ca,size,rate,rank : sort(rate)) key ≡ (r) update?(e) ≡true update(e,row) ≡ (row.r,e.t,e.ca,e.size,e.rate) update?(row) ≡age(row.t) > MaxAge update(row) ≡ (row.r,now,row.cs,row.size,row.rate/K)delete?(row) ≡ (row.rank > N)

In this case keep t but not as a key—use it as a timestamp of the lasttime a resource was updated, and then use this to both decay the requestrate over time and eventually remove resources that have not seen anyactivity for MaxAge units of time.

The reducer and collector implementations given above show examples ofthe use of the pure reducer and collector functions to developarbitrarily complex reducers and collectors. These examples are givenfor purposes of description and explanation only, and are not intendedto limit the scope of the system or any actual implementation. Those ofordinary skill in the art will realize and understand, upon reading thisdescription, that different and/or other implementations of reducers andcollectors are possible, and those are contemplated herein.

Various examples of the use of reducers/collectors are provided here. Itshould be appreciated that each of these examples may be implemented, inwhole or in part, using the generic reducer/collector described above.

Load

The OMA's load mechanisms include load measurers 123, load monitors 132,and load analyzers 142 (with reference to FIG. 4-B). Load measurers 123may actively monitor aspects of the load on the network and the CDN.Mechanisms dispersed throughout the CDN 100, including preferably atsome caches, provide load-related information to the OMA 109 (i.e., tocollectors 106 acting as load monitors and/or load analyzers) viareducers 107 (i.e., via an NDR).

For example, as shown in FIGS. 12-A-12-B, caches 102, produce andprovide (e.g., push) events streams (including, e.g., load informationand/or information from which load information can be derived, andhealth information and/or information from which health information canbe derived) to appropriate reducers 107. The reducers 107 reduce andconsolidate the information in the event streams, as appropriate, andprovide it to the CDN's appropriate collectors 106 (e.g., collectorsproviding services as load monitors and gatherers 132, collectorsproviding services as health analyzers 134, and collectors providingservices as load analyzers 142). The load monitors and gatherers 132 inturn provide gathered/collected load information to load analyzers 142which, in turn, provide load information to various generator mechanisms128. The load information provided to the generator mechanisms 128 maybe used, alone, or in conjunction with other information (e.g., healthinformation) to provide information to the control mechanism 108. Thecontrol mechanism 108 may then provide control information, asappropriate, to the rendezvous mechanisms 104 and to other CDNcomponents (e.g., the caches 102). The collector(s) 106 may also providestate information to the caches 102.

Note, as shown in the drawing (FIG. 12-A), the collector(s) may alsoprovide state information directly to the caches 102, so that cacheoperation may be controlled directly and not only via the control 108.This state information may correspond to the “S local” state informationshown in FIG. 4-E.

Load information may be used (alone or in conjunction with otherinformation such as, e.g., health information), e.g., to configure orreconfigure aspects of the CDN. For example, load information may beused (alone or in conjunction with other information, e.g., network loadinformation and information about the health of the network and thevarious caches) to allocate caches to CDN regions or segments and/or toset or reset caches' roles.

When health information is used by one of the generators 128, thatinformation may be obtained using an appropriate health monitoring andgathered from/by appropriate collectors.

The load mechanisms may use the load reducer described above.

Popularity

Content analytics reductions provide all that is needed for popularityevaluation of specific resources. This data may be provided back to thecaches and/or the rendezvous system and may be used to implementpopularity-based handling of requests.

With reference to FIG. 12-C, the CDN's caches 102 and possibly otherservices may produce log data (e.g., as an event stream) relating toresources requested and served on behalf of the CDN. This loginformation is preferably provided (e.g., pushed) by caches, viareducer(s) 107, to appropriate collectors 106 that can function aspopularity analyzer(s) and/or popularity data generators 152. Popularitydata generators 152 may generate data for use by the caches 102 (e.g.,for use in pre-populating caches, and/or for redirecting resourcerequests). In addition, popularity data generators 152 may also generatedata for use by the rendezvous system 104 (e.g., for use in directingresource requests to appropriate locations).

The rendezvous mechanisms 104 may produce log information relating torendezvous requests and/or rendezvous made. When the rendezvous systemincludes a DNS system, the log information produced by the rendezvoussystem may include name resolution information, including, e.g., thenames provided to the rendezvous mechanism by resolvers and the resultsof name resolutions. Name resolution information may be gathered by therendezvous monitor and gatherer 137 and may be analyzed by therendezvous analyzer 147. Rendezvous information (e.g., name resolutioninformation) may be used alone or in combination with resource requestinformation to determine aspects of resource popularity. Thisinformation may be particularly useful when a resource may be requestedusing multiple URLs having different hostnames associated therewith. Insuch cases, the rendezvous information in the form of name resolutioninformation can be used to determine which of the URLs is being used torequest the resource.

In preferred implementations there are two ways to address popularityusing some separate source of information about the popularity of aresource.

-   -   (1) Alter the responsibility computation to include popularity,        making more nodes responsible for popular resources than for        unpopular (non-popular) resources.    -   (2) Handle popularity separately before responsibility. Redirect        for unpopular objects (without regard to responsibility        computation), apply usual responsibility-based peering only if        popular.

These approaches can be combined, allowing more than just aredirect-or-follow approach. In some cases the CDN can vary the numberof nodes which will store the resource as a function of popularity,size, etc.

The CDN can also use local feedback for tuning of the popularity servicebased, e.g., on performance of the cluster. Reducer also ensures thatcache hits will still affect popularity, though with some time lag.

Rendezvous using resource popularity is described, for example, in U.S.Pat. No. 7,822,871 titled “Configurable Adaptive Global Traffic ControlAnd Management,” filed Sep. 30, 2002, issued Oct. 26, 2010; and U.S.Pat. No. 7,860,964 titled “Policy-Based Content Delivery NetworkSelection,” filed Oct. 26, 2007, issued Dec. 28, 2010, both of whichhave been fully incorporated herein in their entirety for all purposes.

A popularity-based system may use the popularity collector describedabove.

Billing

As noted, the CDN's caches 102 may produce log data (e.g., as an eventstream) relating to resources requested and served on behalf of the CDN.The log data may be used to determine not only which resources wererequested, but also information about whether/how the requestedresources were served. This log information is provided (e.g., pushed)by the caches, via reducer(s) 107, to appropriate collectors 106 thatcan function as gatherer mechanisms 136 and/or as billing reporters 140in the OMA 109 to produce customer billing information.

Those of ordinary skill in the art will realize and understand, uponreading this description, that billing information may be generatedbased on different and/or other factors. For example, as shown in FIG.12-D, in some cases rendezvous data may also be used to generate billingdata information.

The OMA billing mechanisms may use the billing reducer described above.

Reporting

CDN services may produce log data (e.g., as event streams) relating tovarious aspects of their operation. E.g., caches 102 may produce logdata (e.g., as an event stream) relating to resources requested andserved on behalf of the CDN; rendezvous services 104 may produce logdata (e.g., as an event stream) relating to name resolution requests onbehalf of the CDN, etc. This log information may be provided (e.g.,pushed) by the various services via reducer(s) 107 to the appropriatecollectors 106, which, in turn, function to gatherer, measure, analyzeand report this information. For example, as shown in FIG. 12-E, logdata (as event streams) may be provided to monitors and gatherers 120,measurers 122, analyzers 124, reporters 126.

For example, collectors may report information about which resourceshave been requested and/or served, information about load on the system,information about popularity of resources, etc.

Reports (or reporting) may be provided directly to customers and may beused within the CDN to maintain records and analyze CDN operation. Theterm “reports”, as used herein, includes reports in any form (includinggraphical and/or textual), including reports provided in real time.

It will be appreciated that customers will only be able to see reportsabout their own properties. The system may provide for reportcustomization and summary information. The system may also providereport information about the quality of service associated with acustomer's contents' delivery.

As noted, a collector may combine the functionality of various aspectsof the OMA. Thus, e.g., the functionality associated with gathering,measuring, analyzing and reporting may be combined into a singlecollector.

BUA (Bandwidth Use Analysis) Logging

All of the information needed by BUA logging is derived from or could becontained within the request event stream. Therefore, a separate set ofBUA events can be generated by a reduction on the request event stream,thereby obviating the need for in-cache accumulation of usage countersand avoiding the need to generate and merge additional BUA log files.For measurements that are not appropriate to generate with each request,services can generate additional events when appropriate, and reducethese.

Content Analytics Logging

Reductions on request event streams can be used to compute variouscontent analytics results, such as the most popular N resources perproperty for any given time period, or the request count for variousgroups of resources (defined by URL patterns). These may be computedglobally as well as according to different geographical regions. Thesemay be implemented using the Analytics reducer described above.

Load and Availability Monitoring

Each cache could generate events to track availability of VIPs, load,and local resource consumption as a function of time. In addition,external monitoring services could test the externally perceivedavailability of other services and generate events. These events couldbe reduced to produce aggregate availability, load, and resourceconsumption metrics for clusters, data centers, metropolitan areas,etc., and derived streams could be defined to generate alarm events whenvalues at specific times and locations go out of tolerance. Monitoringapplications, as well as the control mechanism itself, could thensubscribe to these alarm streams to generate alerts and other responseactions. These may be implemented using the Load reducer describedabove.

Invalidation Monitoring

The completion of an invalidation command can be recorded as an event,and the sequence of invalidation events can be reduced to providefeedback to the invalidation portal as to whether or not theinvalidation command has been completely processed or not.

Resource Request Prediction and Prefetching (Site Optimization)

The sequence of requests that will likely follow a request to any givenresource could be computed (estimated) using an unsupervised learningalgorithm, such as a priori, generating for any given resource a shortlist of likely future resources to prefetch. Unlike some approaches tosite optimization, this computation does not involve introspection ofthe resources themselves, is not dependent on assumptions that resourcereferences will be based on static HTML links, and can take localityinto account (the prefetch list computation may vary from one localityto another).

Media Resource Storage and Management

A similar analysis to the resource request prediction and prefetchingdescribed above can be used to group resources optimally on disk. See,e.g., U.S. Pat. No. 8,140,672, filed Apr. 26, 2010, issued Mar. 20,2012, titled “Media Resource Storage And Management,” publication No. US2010-0325264 A1, the entire contents of which are fully incorporatedherein for all purposes. A common file (a so-called multi-file) may becreated for certain content (e.g., a media resource) based, e.g., ameasure of popularity of the content or on other behavior patternsrelative to the content.

Real-Time Application-Specific Analytics

Applications could be allowed to define their own analytics reductions,for example, to map specific resources to resource roles, and sequencesof requests could then be reduced into sequence of these resource roles(like [showPageA1, buyProductX]). Metrics regarding the frequency ofthese sequences could then be used in the request/response processing togenerate requests for, e.g., the page that is most likely to result in apurchase in this particular location.

Global Hierarchical and Localizable Cached Resource Index

Assuming that substantially each cache fill and each cache evictiongenerates an event, the streams of these events from all caches in thenetwork may then be reduced to determine an estimate of which machines(or arbitrary groups of machines) contain which resources (or arbitrarygroups of resources) in cache.

The index could then be queried to determine where to find a resource incache. Assuming a hierarchy of indexes, roughly corresponding to thehierarchy of reducers that produce the inputs to the indexer, a requestto find a resource in a nearby cache could be issued to the indexerresponsible for the smallest area containing the requesting cache, andthen bumped up to higher levels if not found.

Assume the events have the following form:

(node,time,resource,action)

Each request results in zero or more of the following event actions tooccur for the requested resource (ignoring actions which do not changeto location of a resource in the machine's cache hierarchy):

-   -   fill from remote source to local disk    -   copy within machine from local disk to local memory

In addition, other resources may be moved or removed as a result,causing zero or more of the following events to occur for some number ofother resources:

-   -   evict from memory to local disk    -   evict from local disk

The first order reduction of this event stream would therefore justmaintains a cache hierarchy location for each resource that is somewherein cache at a node, and higher order reductions just maintain a count ofthe number of nodes at which a resource is cached at some level on thegroup of machines in the scope of the reduction. This reductiongenerates updated cache location states for resource groups and machinegroups which can be consumed by an indexer. Processing a count of 0 is adeletion, processing a count >0 is an insertion or update for a resourceat some location. The reduction would also reduce events over timeintervals, showing the net effect of a sequence of events for the sameresource within a given time interval as a single event.

Applying some elements of applications discussed earlier, this reductionand indexing work could be conditionally applied only to those resourceswhose popularity exceeded some threshold, for example, or only forcertain types or resources, or resources that matched patterns, orbelonged to certain properties.

Now, with the index available, the cache can actually query the localindexer on cache misses to determine where to go to get the resource.The indexer could present its information to the caches in the form ofresources which are themselves cacheable, so the cache would maintain alocal cache of the indexers results for the resources about which itcares (relying on sectoring and sequence numbers). In essence, for mostremote fills, the cache uses its local cache of the “directory” forwhere to get resources (which could be a hierarchy of resourcepatterns), updating it only on expiration or explicit invalidation.Invalidations could be generated automatically by the indexer, and wouldonly travel to the local caches which are storing copies of thelocalized index results. The system could also provide conversion ofwildcard invalidations to a set of front-door invalidations using thisdata.

It should be appreciated that there is a delay between a change in thestate of a resource at a cache node, and the reflection of that statechange in the reductions and indexes, so the index just provides anindication of where the resource might be based on where it wasrecently. In a worst case, the cache will request the resource from theplace the index told it to request it from, but the resource will notactually be there. In this case there will need to be an appropriateresponse (such as the requested cache getting it from a parent ororigin, or it responds to the requestor with a redirect or errorresponse).

Index of Resource Metadata

The index of the previous section could also be extended to storeadditional resource metadata, like the size and popularity of theobject. So even if the index says it is not cached, the system may wantto keep the index entry around to be able to know what kind of objectits dealing with so that it can handle the fill (or redirect) in theappropriate way. For example, something that has been seen before (sayin the last day) but is nowhere in cache might be an unpopular objectthat the cache can deal with by redirecting.

Adaptive Capacity Allocation

Assume each cache cluster is bound based on the set of sectors it isexpected to serve (which is determined somewhere upstream and relayed tothe machines in the cluster via the control mechanism 108). Thissectoring limits the set of properties that any given machine isexpected to know how to serve, which further constrains the serviceswhich must be configured on the machine, as well as the set ofinvalidations which the machine may need to process.

This binding also constrains the set of machines which are available toserve a given property globally. Preferably the system monitors andmanages that set of machines, perhaps with some allowance for steeringby operators. Accordingly, the control mechanism 108 and the NDR/Ccollaborate in an automatic, closed-loop, feedback control system.

The NDR/C is just one of several parts of this feedback system. Viasuitable reductions the system could find out whether the load due toresources in a sector (or a property) was too much or too little for themachines currently configured to serve those resources. If this is toomuch or too little, an adjustment can be ordered. This adjustment couldbe constrained by predefined policies, but would otherwise proceedautomatically. A suitable control algorithm which takes both the latencyof measurements and the latency of actions and their effects would berequired in order to react to changes without overreacting.

An example of a simple adjustment is moving a cluster from one sector toanother (or adding a new cluster to a sector from a pool of availableclusters, and removing a cluster from service and putting it back intoan unused pool). Assuming this does not require any software changes(just possible reconfiguration of the software that is already there);the control mechanism 108 would update or invalidate the controlresources which tell the cluster which sectors it should care about,removing one and adding another. It might also be useful to direct thecache to purge all resources from the old sector and to prefetch all themost popular resources from the newly added sector before the rendezvoussystem is updated to start directing clients to it for properties inthat sector.

Adaptive Deployment

Control and/or state information can be used by a CDN component (e.g.,machine) to re-configure services already installed on that machine. Inaddition, using the Autognome service (described above), theconstellation of services running on a machine can be partially orcompletely changed based on control and/or state information. Thus,using feedback from any aspects of the CDN, a machine's role may bechanged to meet capacity needs in the CDN. For example, a machine thatwas providing caching services may be re-allocated to act as arendezvous mechanism or a reducer or a collector.

It should be appreciated that in order to reallocate capacity it mightbe necessary to install or uninstall specific kinds or versions ofservices that do not normally run on all flavors of machines.

Peering and Parent Selection

Reducers/collectors may be used for peering and/or parent selection.Peering may make use of reductions of, e.g., popularity, cacheability,and size to determine which peering policy is preferably, but notnecessarily, used for a given resource based on a match between theresource's popularity, cacheability, and size and the correspondingthresholds defined for each policy. Parent selection may be based on areduction of the cost/performance of retrieving certain resources orproperties from certain parents by certain client caches, and the parentthat delivers the best results for a given client may be chosen.

Configuration Information

As shown in FIG. 1-J, the CDN includes configuration information 1004and state information 1006. Preferably the control mechanism 108 (FIG.4-A) maintains at least some of the control and state information. In anembodiment, the CDN maintains the following (with reference to FIG.13-A):

Customer information: includes information about which entities arecustomers of the CDN, information about customer properties, etc. Theinformation about a customer's properties may include information aboutcustomer-specific or property-specific handling of resource requests forthat customer's properties. Since a customer's properties may be handledby caches in a particular sector, the customer information may alsoinclude information about which sector or sectors are responsible forwhich properties, i.e., about the binding of properties to sectors. Theinformation about a customer's properties may also include invalidationinformation regarding those properties. Note that the CDN (and eachsub-CDN) may be considered to be a CDN customer. Thus, the CDN maintainsinformation about CDN properties, including property-specific handlingrequests and invalidation information for those properties.

Configuration information: includes information about the manner inwhich services (e.g., caches and other services) are configured withinthe CDN and information about and for the rendezvous system. Theconfiguration information may include static (i.e. relatively static)information which may include information about sub-CDNs, groups, tiers,sectors, peers, caches' roles, flavors, etc. It should be appreciatedthat the CDN is a dynamic entity and that the CDN configuration may bechanged during its normal operation. For example, a component's role(s)may be changed if needed (e.g., a cache may be allocated to a differentgroup or sector; a cache's peers may change, etc.). The term “relativelystatic” is used here to refer to information that may not change in anyparticular time interval of appropriate resolution (e.g., 1 min., 5 min.and the like). The CDN configuration information may be set by the CDNoperator and/or, in some cases, by CDN customers. In addition, the CDNconfiguration (and therefore the CDN configuration information) may bechanged (e.g., using Autognome) based on feedback provided by thereducer/collector services.

Status information: includes information about the status (e.g., health)of the various components of the CDN, the load on the components of theCDN, load on the network, etc. Status information is typically dynamicinformation in that it typically changes in any particular time intervalof appropriate resolution (e.g., 1 second, 5 seconds, and so on). Statusinformation may be obtained, e.g., via the reducer/collector services.The status information may be information that has been produced by someother mechanism (e.g., in the OMA) and may be provided in a state orform that is useful for the CDN components (e.g., the rendezvoussystem).

Resource information: this includes information about properties,including which properties have already been served or requested, andthe validity of resources. Those of ordinary skill in the art willrealize and understand, upon reading this description, that there is noreasonable way for the CDN to know in advance of all possible resourcesthat it may be requested to serve. A CDN should, however, know inadvance enough about the resources it has been configured to serve inorder to accept requests for those and reject others. (Although a CDNcould be aware of all possible resources that it may be requested toserve in the future, such a limitation would severely limit the benefitsof a CDN.) The CDN can, however, know about the resources that it hasalready been requested to serve and that may therefore be resident onone or more caches in the CDN. The resource information thus preferablyincludes invalidation information regarding resources that the CDN hasserved or has been requested to serve (this includes CDN resources aswell as a customer or subscriber resources).

The information that the CDN knows is preferably maintained, at least inpart, in one or more control mechanism databases. Various CDNcomponents/services may obtain needed information from the controlmechanism 108.

Services' Configuration Information

In an embodiment, each CDN service includes some configurationinformation in order to operate within the CDN. The kind ofconfiguration information needed depends, at least in part, on the kindof service. In an embodiment, each service knows its identity and alocation from which control and configuration information can beobtained.

The Primary Delivery Services' Configuration Information

With reference now to FIG. 13-B, each primary delivery service (e.g.,caching, streaming, compute) knows information about the customers andproperties for which it is responsible in accordance with an embodiment.Each primary delivery service also preferably knows information aboutits role in the CDN, which services are its peers, and where it issupposed to send event information. The information about the customersfor which a delivery service is responsible may be provided to thedelivery service as a CDN resource that lists sufficient information forthe delivery service to determine whether or not it should try to handleany particular resource request. When delivery services (e.g., caches)are organized as sectors and/or as sub-CDNs, each service preferablyonly knows about (i.e., is only provided with information about) thosecustomers and properties associated with its sector and/or sub-CDN.

In some cases a delivery service may be told (e.g., at configurationtime) what its role is to be and which other delivery services, if any,are its peers. A delivery service may also attempt to determine peerservices based, e.g., on the delivery service determining its positionin a cluster. It should be appreciated and understood that even though aservice may have peer services, various policies (including, e.g.,customer specific request handling policies) may determine how eachdelivery service interacts with its peers and what information adelivery service may obtain from or will provide to its peers.

The Rendezvous Services' Configuration Information

As noted above, rendezvous is the binding of a client with a targetservice. For example, in the case of a DNS-based rendezvous system, theRendezvous system maps domain names (typically CNAMEs) to IP (or VIP)addresses or to other CNAMEs. In an embodiment, each rendezvousmechanism (or service) knows the properties for which it is responsibleand have sufficient information to provide the rendezvous service forthe properties for which it is responsible.

The information needed by a rendezvous service to perform this mappingis part of rendezvous information in FIGS. 13-A and 13-D.

The rendezvous information (FIGS. 13-A and 13-D) is a CDN property thatmay be resident on or available to the rendezvous service and controlledvia control resources with the usual update/invalidation approachdescribed herein.

Beyond the names associated with the set of properties, and the set ofVIPs assigned (bound) to each, in some cases a rendezvous service knowsthe relative load (and capacity) of the service end points andconnectivity data showing network distance from each such end point tothe requestor.

The Collectors' Configuration Information

In preferred implementations, the information used by a collectorservice (with reference to FIG. 13-E) includes where the event streamsare coming from, what the history for each needs to be (i.e., how toperform the ‘collection’ process); what data to make available; andwhere to provide that data.

The Reducers' Configuration Information

In preferred implementations, the information used by a reducer service(with reference to FIG. 13-F) includes information about where the eventstreams are coming from, where they should go to, and the reductionprocess for each stream type.

Control Mechanism Architecture

As shown in FIG. 1-A, services types in a CDN include configuration andcontrol services. FIG. 1-F shows a network of configuration servicesproviding configuration information to a network of control services,and, as described with reference to FIG. 1-J, an exemplary CDN 1000 mayinclude configuration services 1008, control services 1010. FIG. 4-Ashows a control mechanism 108 made of control services 1010.

The following sections describe various organizational structures andimplementation options for the control mechanism. It should beappreciated that these descriptions are given only by way of example,and are not intended to limit the scope of the system in any way. Thoseof skill in the art will realize and understand, upon reading thisdescription, that a particular implementation may use a differentapproach or may use some of the features described here.

Exemplary Control Mechanism Alternate Embodiment

An exemplary control mechanism 108 for an alternate embodiment isdescribed here. As shown, e.g., in FIG. 14-A, the control mechanism 108can be considered to consist of two loosely coupled sub-clouds, thedirector cloud 702 and the control cloud 704. The director cloud 702includes one or more director sites (director server sites) 706 (in thedirector cloud 702 shown in FIG. 14-A there are ND director sites DS₁,DS₂, . . . , DS_(ND), respectively denoted 706-1, 706-2 . . . 706-ND).The control cloud 704 includes one or more control servers 708 (in thecontrol cloud 704 shown in FIG. 14-A there are NCS control servers, CS₁,CS₂, . . . , CS_(NCS), respectively denoted 708-1, 708-2 . . . 708-NCS).

By way of example, FIG. 14-B shows an exemplary control mechanism 108with three director sites (D1, D2, D3) and five control sites C1 . . .C5. As shown in FIG. 14-B, data are provided by (e.g., pushed from) thedirector cloud to the control cloud (i.e., from director sites tocontrol sites). Data from the control cloud (control sites) are providedto (e.g., pulled by) the caching network.

The director cloud 702 processes transactions from interactive users andbatch systems and transfers updated control data to the control cloud704, which in turn provides the same data (or some version ortransformation or subset thereof) to the caching network 710(corresponding to caches 102 in FIG. 4-A) and/or to other CDN components712.

The clouds may communicate with each other and with additional systemsvia, e.g., so-called REpresentational State Transfer (REST) webservices.

Each cloud is preferably, but not necessarily, a globally distributedsystem with high-availability, but loose coupling between the cloudsallows each to be designed and scaled independently to take advantage oftheir unique requirements. Director sites 706 are preferably optimizedto provide read/write access involving moderately complex queries for arelatively small collection of users (perhaps hundreds), whereas controlsites are preferably designed to provide read-only access involving verybasic queries to a large network of tens of thousands ofhigh-performance caching nodes. Since the director cloud 702 pushes datainto the control cloud 704, and control sites cache data for each other,increased load on the control sites 708 does not spill over as load onthe director sites 706. As the granularity of resources served by theCDN changes (e.g., from a small number of large properties, to a largenumber of small properties) the effects on the two systems will bedifferent and can be handled separately. The reliability, availability,and performance characteristics of the two sub-clouds are largelyisolated.

As noted earlier, the control mechanism 108 may comprise multipledatabases that are used and needed to control and operate variousaspects of the CDN 100. These databases 714 may include directordatabase(s) 716 and control mechanism database(s) 718. Although shown asa single collection of database(s) 714, it should be appreciated thatmultiple versions of each database may be (and typically will be)present in the control mechanism 108 (for this reason the databases 714,716, and 718 are shown with dashed lines in the drawing in FIG. 14-A).From the outside, the control mechanism 108 should present a view ofwhat appears to be a single and current version of each database, whileinternally there may be differing versions of the databases. Eachdirector server 706 preferably maintains a local version of at leastsome of the databases 714. Thus, as shown in FIG. 14-C, director serverDS₁ (706-1) has a local version 714-DS1 of the databases 714; directorserver DS₂ (706-2) has a local version 714-DS2 of the databases 714; andso on. Similarly, each control server 708 has a local version of atleast some of the databases 714. Thus, as shown in FIG. 14-C, controlserver CS₁ (708-1) has a local version 714-CS1 of the databases 714;control server CS₂ (708-2) has a local version 714-DS2 of the databases714; and so on. As shown in the drawings, the control servers may onlyrequire or use local versions of the control mechanism database(s) 718.

Control sites 708 are the control mechanism 108 servers contacted(typically directly) by CDN components/computers, e.g., the cachingnetwork 710 for delivery of metadata, configuration files,invalidations, etc. (collectively referred to here as controlresources), and director sites 706 manage a director database of controlresources and direct the flow of updates into the control mechanism.Updates typically begin with the invocation of director site services onbehalf of users of interactive portal applications. The director siteservice then commits the changes to the director database 716 and thenreliably transfers the updates to selected control sites 708. Finally,control site updates diffuse across the rest of the control mechanism108 and into the caching network 710.

FIG. 14-D shows aspects of the feedback loop (see, e.g., FIGS. 1-E, 1-Fand 1-L) in which data from the CDN services (e.g., from event streams)are collected (by collectors 106 via reducers 107) and then used togenerate control data. The director cloud 702 obtains data from thecollector(s) 106 and provides appropriate data to the control cloud 704.Components of the CDN 100 (e.g., caching network 102 and the rendezvoussystem 104) obtain (e.g., pull) data from the control cloud 704.

As noted above, origin resources served by the CDN are preferablytreated as properties, with each property corresponding roughly to theresources of a single origin server. In order to take advantage of theexpected spatial locality of reference, the set of properties ispreferably partitioned into sectors. Each property is preferablycontained entirely within one sector, but a sector may contain anynumber of properties.

Each sector (or the information associated with each sector) ispreferably replicated by multiple control sites at any given time, andeach control site 708 may replicate any number of sectors at one time(see FIGS. 14-A to 14-B). All updates to information within a sector arereliably transmitted from a director site 706 to all the replicas forthat sector (i.e., to all sites having replicas of that sector). The setof control sites replicating the data of a given sector is referred toherein as the cohort for that sector.

Site and Group Identifiers

For any given configuration of the control mechanism 108 there is amaximum number (ND) of director sites, maximum number (NCS) of controlsites, and a maximum number (NS) of sectors. These maxima determine therange of acceptable site and sector identifiers, as follows:

DirectorSiteIDs={0, . . . ,(ND−1)}

ControlSiteIDs={0, . . . ,(NCS−1)}

SectorIDs={0, . . . ,(NS−1)}

For implementation purposes, these various IDs range from zero (0) tosome maximum value (e.g., 0 to ND−1). However, for the sake of thisdescription the ranges may be specified as having a first value of one(1), e.g., 1 to ND). The identifier for a given director site, controlsite, or sector is fixed. Each director and control site also has astatically defined peer group which may be based on a fixed function ofthe site ID. The function may be arbitrary, as long as it is fixed inadvance and all sites use the same function. For example, the functionθ(s)={p|p mod N=s mod N} for fixed N divides the sites up into groups ofN. It should be appreciated that peer groups are used for primaryinitialization and recovery and are not the same thing as neighborhoods,which may change dynamically.

Sequence Numbers

Sequence numbers may be used to provide relative order information aboutupdate and invalidation events. A sequence number may be considered tobe a virtual and scale-free timestamp, a monotonically increasinginteger where the higher the number the more recent the event (at leastwithin a single sequence number domain, as comparisons of sequencenumbers are only meaningful within the same sequence number domain).Each sequence number is relative to a local virtual clock for some scopeat some location. Furthermore, although sequence numbers aremonotonically increasing, they do not increase on a uniform periodicbasis, only when something changes.

It should be appreciated that a particular implementation may not havesequence numbers at the level of the master directory/journal.

Control sites may have two levels of sequence number domains, the sectorlevel and the property level. A sector increases its sequence numberwhenever the sequence number of a property governed by the sector isincremented. Properties increase their sequence numbers whenever anyresource contained in the property is updated or invalidated. Sectorlevel sequence numbers also change when properties migrate acrosssectors.

Although individual resource invalidations could result in new sequencenumbers for each individual resource invalidation, the system allows forthe possibility that the effect of multiple invalidations on thesequence number could be batched together, so an increment from sequencenumber N to N+1 could potentially involve any number of involved changesat any level. This could be caused by batch invalidations, or by otheraspects of the way the control site user interface interacts with theunderlying database.

Timestamps

Sequence numbers do not use timestamps, and there is generally no needfor any global clock synchronization. However, in some cases it may beuseful to have approximate and low-resolution timestamps which providecoarse ordering information that can be used to improve efficiency.Generally, with bounded clock skew and low enough resolution the systemcan arrange such that anything that is marked as having an approximatetimestamp T2>T1 can be assumed to be newer than something with atimestamp T1, but this cannot be relied upon for correctness.

Directories and Journals

Invalidation journals are lists of resources marked with sequencenumbers. Such invalidation journals indicate which resources have beeninvalidated and when they were invalidated. Caches or other CDN entitiesmay use invalidation journals to decide which of their locally cachedresources to invalidate. Although journals may be generated or updatedas a result of human operator-driven events, one invalidation commandissued by a human may result in a flurry of invalidation requests, andthe cumulative effect of ongoing operations can sometimes result inloads of many thousands of invalidation requests per second. The contentof these resources may be represented, e.g., in JSON (JavaScript ObjectNotation).

Master Journal

A master journal is a list of control mechanism metadata along withsector and control site descriptors. The sector descriptors define thecurrent sector sequence number and sector cohort for each sector, andthe control site descriptors define the replicated sectors and controlsite neighborhood for each control site. Listing the replicated sectorsis redundant with the sector cohorts, but is provided for convenience.In JSON, a complete master journal might look like the following (seealso, e.g., FIG. 14-E):

  {  seq: N,  numDirectorSites: NDS,  numControlSites: NCS,  numSectors:NS,  sectors: [   { id: 0, seq: S0, cohort: [1,3,4] },   { id: 1, seq:S1, cohort: [2,3,4] },   ...  ],  controlSites: [   { id: 0, seq: CS0,nbhd: [9,11,12,19] },   { id: 1, seq: CS1, nbhd: [8,11,13,17] },   ... ] }

In the example above, the sector with Sector ID 0 has cohorts 1, 3, and4. That is, control sites 1, 3, and 4 are replicating sector 0. Thesequence number for Sector 0 is S0. The sector with Sector ID 1 hascohorts 2, 3, 4. That is, control sites 2, 3, and 4 replicate sector 1.Sector 1 has sequence number S1. As also shown in the above, controlsite 0 has neighborhood sites 9, 11, 12, and 19; and control site CS1has neighborhood sites 8, 11, 13, and 17. The sequence number forcontrol site 0 is CS0, and the sequence number for control site 1 isCS1.

Sequence numbers represent the current sequence number of the givenscope as viewed by the provider of the journal at the time the journalwas provided. An incremental master journal would be a list of partialspecifications of a master journal, as in:

  [  {   seq: N1,   sectors: [    { id: J, seq: SJ, cohort: [...] },   ...   ]  },  {   seq: N2   controlSites: [    { id: K, seq: CSK,nbhd: [...] },    ...   ]  } ]

It should be appreciated that the “master journal” is not really ajournal in the database sense of the term. It may also be referred toherein as a manifest.

Sector Journal

A complete sector journal lists the current sector sequence number andinformation about all the properties in the sector (see also, e.g., FIG.14-F):

  {  seq: N,  props: [   { id: PID0, seq: PS0 },   { id: PID1, seq: PS1},  ...  ] }

In the example above, property PID0 has sequence number PS0 and theproperty PID1 has sequence number PS1.

An incremental sector journal is an array of partial sectorspecifications, showing only the changes of each specification in thesequence relative to the complete specification of the previous sequencenumber.

Sector Directory

Sector directories are control resources that specify what propertieslive in what sectors. Sector directories are provided to enable cachesand control sites to correct their notion of what properties live inwhat sectors. Whenever a property is moved to another sector or deletedfrom a sector, the involved sectors are invalidated. Such aninvalidation increases the sequence number of the sector but does notnecessarily generate any invalidations of other resources in the sector,other than for the sector directory's deletion journal,/sector/SID/directory/deletions. When a sector directory invalidationoccurs at sequence number N, the new sequence number becomes M=N+1, anda request to:

GET/sector/SID/directory/deletions?seq=K

for some value K≧M will return a list of the deleted properties and themoved properties (along with their new sector homes). Additions will notbe shown. The invalidation journal for the sector will also show thatthe resource /sector/SID/directory/deletions was/were invalidated atsequence number M.

From a caching perspective there is really no need to keep track ofadditions to a sector (because such additions could not have beenpreviously cached), but the system may do so anyway for the benefit ofother tools, via /sector/SID/directory. So while the value of the/sector/SID/directory resource can be used to list all properties, thisresource is never explicitly invalidated, it just expires, because, inpreferred implementations, the system never wants to force a cache torequest a sector journal just because of a new property addition.Additions of properties to the sector will silently cause new propertiesto show up in the directory on the next request, but the deletionjournal will not be changed and a sector directory invalidation will notoccur.

Property Journal

A property journal lists the sequence number of the property and thelist of resource descriptors for the resources that were invalidatedwith that property sequence:

  {  seq: N,  invalidated: [   { uri: “foo.com/folder/thing” },   ...  ]}

Configuration Files and Other Control Resources

Configuration files define configuration settings which may affect thedynamic behavior of both the control mechanism and the nodes in thecaching network. Operators of the control mechanism may use customizedtools to generate and publish such configuration files to the controlmechanism. Other than the association of configuration files to certainsectors and properties, the control mechanism need have only minimalknowledge about the structure, file naming conventions, automaticgeneration process, and content of these files—as far as the controlmechanism is concerned, they are opaque resources.

Control metaobjects are used to describe the existence and basicproperties of real-world entities, such as CDNs, customers, properties,control sites, director sites, etc. These metaobjects are expected to berelatively static, changing at the frequency of human-controlledadministrative events. The content of these resources may be representedin JSON or some other such language.

Upon receipt of a directory update, each replica site merges the updatewith the state it already has for that sector. Sequence numbers can beused to ensure that no updates are applied out of order and no updatesare missed. Each control site 708 also periodically pulls and mergessector data from selected neighboring control sites. The effect of thiscache diffusion combined with director updates is that each control siteis eventually consistent with every sector in the director database.

The distinction between caching a sector and replicating a sector isimportant. All control sites may cache information for any sector, buteach control site is considered a replica site for some limited set ofsectors (i.e., the cohorts for those sectors). When a control site isreplicating a sector, that means it will receive reliable updates pushedfrom directors to the entire cohort of a sector, and the director willmonitor the success of these messages and retry until enough sitessucceed. Caching, on the other hand, involves the periodic pulling ofpossibly older copies of sector information indirectly from othercontrol sites. In both cases, new data are merged with old data based onsequence numbers to ensure that no updates are ever missed. A masterdirectory defines sector cohorts (for replication) and control siteneighborhoods (for cache diffusion).

Director sites 706 receive update commands from other systems, and theseupdates translate into a sequence of changes to the director database716 for given sectors, which should preferably then be distributed tocontrol sites 708. When distributing updates, directors shouldpreferably collaborate to ensure that all updates to a given sector willbe presented to the control site replicas as if they were coming from asingle responsible director agent, one at a time, after each update hasbeen committed to the director's database. Each update defines a newsequence number, and the director keeps track of which sector updateshave been successfully transferred to which control site replicas, beingsure to transfer them in the right order. But the protocol between thedirector and the control sites for a transfer is a simple push andresponse with retry until enough succeed—there is no multi-phase commitor other distributed consensus protocol required. The director hasalready decided unilaterally that the changes are to be made and hascommitted them to the director database, and it is just notifying thecontrol sites of its decision. It just needs to make sure that eachdecision is acknowledged by enough of the replicas before moving ontothe next one.

Control sites which fail and restart should preferably first performlocal recovery to get back to a certain sequence number for each sector(based on information written previously to stable storage), thenrecover the latest master directory from the peers in their group (whichdepends only on control site ID). After that, the control site'sneighborhood and the set of sectors it is responsible to replicate aredefined, so it then recovers sector updates from each sector cohort, andthen begins refreshing its cache of other sectors from its neighborhood.Control sites preferably do not contact directors for recovery. When acontrol site receives an update for one of its sectors, the updateeither succeeds or fails. It fails if the control site is down (thedirector's request will time out) or if the control site has not yetcaught up to the sequence number being proposed. It will respond withfailure but inform the director where it is in the sequence. Successmeans the control site has either just applied the change successfullyand could restore it if the site subsequently fails, or it had alreadypreviously applied the change. The minimum size of any sector cohortwill be set to ensure that even when the worst case number of sitesfails (as specified by the requirements), at least some minimum numberof sites will successfully receive an update from a director. It shouldbe appreciated that although the director's behavior may be adjusted tohave it detect failures of all control sites, in that case the directorwould have to be involved in the recovery of at least one member of thecohort.

If an entire director site goes down, there is no effect on the abilityof the control sites to continue to serve control resources to thecaching network. The only affect is that updates to the resourcescontained in its sectors will not be possible until the director siterecovers, but the control sites will continue to serve their most recentand consistent view of the resources in those sectors. Director sitescan be made arbitrarily robust through the usual means as long asper-sector updates appear as if they are being generated by a singleagent from the perspective of the control sites.

Sector Cohort Management

Each sector is replicated across a cohort of control sites, configuredsuch that at least one control site is guaranteed to be functional atany given time, even in the face of up to k concurrent failures (forsome k specified by the requirements). Sites can be added to or removedfrom a cohort at any time, provided the minimum cohort size is notviolated. Reasons for adjusting the cohorts for a sector might bepersistent changes in geographical load distribution, persistentfailures, or some combination thereof.

All changes to cohort membership are initiated by directors. It may bein response to a request from a human operator, or in response toautomatic health monitoring and load balancing. As far as the controlsites are concerned, cohort membership changes can occur at any time.

This means that some control sites may receive directed replicationrequests for sectors they did not realize they were supposed toreplicate, and some sites will stop receiving such requests for sectorsthey thought they were replicating. Neither of these situations isproblematic.

In the former case (an unexpected replication command), the control sitewill adjust its view of sectors it replicates and will begin replicatingthe new sector automatically. Each replication request indicates thecurrent cohort membership for the sector being replicated, along withthe sequence number of the update. As described above, the recipientwill respond with failure if its cache is not caught up to the sequencenumber (and it will initiate a catch-up recovery with the other membersof the cohort). In the latter case (absence of expected replicationcommands), the control site will eventually learn from a newer versionof the master directory that it is no longer a member of the cohort fromwhich it was expecting replications.

For reasons of efficiency, directors may notify control sites when theyare supposed to stop replicating, but that is not strictly necessary.Ultimately, as far as the control sites are concerned, they replicatewhat they are told to replicate, and knowledge of cohorts is only usedto forward requests that cannot be answered with the local cache.

Health Monitoring

Directors monitor the health of control sites in several ways. Theprimary method is the firsthand knowledge each director site has of theability of each of its replicas to keep up with directed replicationcommands. Sites that repeatedly fail may be called out as suspect, eventhough the cohort as a whole has enough functional sites to functioncorrectly.

The second method is to periodically poll each site for its masterjournal (and possibly other subordinate journals), just like a cachenode would, but in this case for the purpose of evaluating the skew ofthe control site's view of the master journal, sector by sector.

Finally, a director can consult the control site more directly forinformation about its load (e.g., via some resource /cs/CSID/load),presumably with more information about the control site's interactionswith its neighbors, to find out how well the distribution of replicasand the neighborhood settings are affecting that control site's localityof reference.

These latter resources could be delivered through the cache but probablyshould not be. In the case of the load resource, it would suffice todeliver it directly from the control site, update it only when largeenough changes occur, no more frequently than some minimum period (sayonce every 5 minutes), and no less frequently than some maximum period(say once per hour), and use ETag headers for efficiency.

Load Balancing

Using the techniques described above, director sites can monitor thehealth and load of each control site (and may also want to useinformation collectible from the NDC), and from that decide whether ornot any changes should be made to the set of properties contained in anysector, or the set of control sites replicating any sector.

Control Sites

Under normal, steady-state operation, a control site should executethree basic behaviors:

-   -   Receive director updates (to update local replicas);    -   Request resources from neighbors (to refresh local caches); and    -   Receive resource requests (for journals and other control        resources) from neighboring control sites and the caching        network.

Directed Replication

A director update request specifies a new incremental change for somesector (or sectors) which the control site is currently replicating. Ifthe specified sequence number range does not start with the nextsequence number expected by the control site, the control site willreturn a response indicating that the update has not been successfullyapplied, along with its current sequence number.

Cache Diffusion

Each control site periodically consults its neighboring control sites(as specified in the master journal), retrieves each neighbor's view ofthe master journal, and merges them to produce its own view. Whenever aneighbor control site or cache node requests a master journal, the localmerged version of the master journal is provided in the response.

Cache Diffusion Algorithm procedure CACHEDIFFUSION  A(k, s) ← 0 for each(k, s)  loop   WAIT(T)   MERGENEIGHBORS   for each updated sector s do   for each neighbor k do    if k updated s then     A(k,s) ← λ+ (1 −λ)A(k,s)    else     A(k,s) ← (1 − λ)A(k,s)    end if    end for   endfor  end loop end procedure

The merge process generates a list of sectors that were updated, alongwith the set of neighbors for each sector that provided an updaterelative. This list is used to maintain an affinity score A(k, s) foreach neighbor k and sector s that is used to make cache miss routingdecisions. The affinity is an exponential moving average based on someconstant factor 0≦λ≦1. When a cache miss occurs, rather than forward therequest directly to one of the replicas, the system forwards the requestto one of the neighbors based on their past history of providing updatesfor that sector.

Cache Request Processing

Each control site is expected to be able to retrieve a version of anycontrol resource at any time in response to a request from a cache nodeor another control site. If the resource exists locally with the rightsequence number it is provided in a response, otherwise a cache missoccurs. On a cache miss, the site should preferably request the resourcefrom a neighboring control site, update its cache, and return theresponse to the requestor.

For example, when a client requests a sector journal the site executesGetSectorJournal(s, N, L) for sector s, sequence number N and level L.

Get Sector Journal function GetSectorJournal(s,N,L)  if cache containssector journal s at sequence n ≧ N then   return sector journal s for[N, n]  else   if level L ≦ MAXLEVEL then    k ← BestNeighbor(s)   else   k ← ChooseCohort(s)   end if   return FillSectorJournal(k, s, N,L + 1)  end if end function

Requests from the caching network always set L=0, but control sites willincrease the level at each forwarding step within the control mechanism.If the level is below a threshold MAXLEVEL, a best neighbor control sitewill be chosen using the affinity score for that sector. Otherwise, amember of the cohort for that sector will be chosen. This approachallows intermediate control sites to act as caches for other controlsites without any predetermined topology, and it avoids endlessforwarding loops, without requiring members of the cohort to serve allcache misses across the control mechanism.

Individual Control Site Architecture

At any given time an individual control site may have soleresponsibility for some set of sectors, so the control site ispreferably free of single points of failure. Standard techniques forthis are adequate—e.g., a load-balanced tier of web application servers(e.g., based on nginx or Apache), backed by an optional memcached tier,backed by a replicated database (e.g., MySQL master/slave, MySQLcluster, or a NoSQL variant such as MongoDB or CouchDB) should be morethan enough. Sectors and properties provide convenient keys which enablecontrol resources to be sharded (partitioned) over separate databaseinstances.

Each control site is expected to run exactly the same core applicationsoftware as all other control sites (at least as far as control-controland control-cache interfaces are concerned), but the actual deployedconfiguration can vary from one site to another. The REST-ful webservice interface exposed by each control site is the same interface itassumes of other control sites, and the details of the internalimplementation of a particular control site are hidden.

Caching Network Interaction with Control

This section describes the caching network's interaction with thecontrol mechanism. Those of ordinary skill in the art will realize andunderstand, upon reading this description, that the same implementationmay be used by other CDN services to interact with the controlmechanism.

Initialization and Network Formation

Cache's (and other CDN services) discover the IP addresses of availablecontrol sites automatically on startup, preferably using the CDN'srendezvous services (e.g., using a preconfigured domain name for thecontrol mechanism, e.g. control.fp.net).

Pulling the Master Journal

Periodically, according to some configurable control synchronizationperiod (preferably around once per minute), the cache (or other service)retrieves the master journal using its current approximate timestamp T:

GET/journal/master?tval=T

This request returns an absolute journal, a complete list of all sectorsand their sequence numbers, as viewed by the journal provider atapproximate timestamp T (which is expected to have a resolution derivedfrom the expected synchronization period that cache nodes will use,e.g., minutes, relative to a distinguished time zone). Caches areexpected to request this resource no more often than the resolution ofthe timestamp provides, though they may request it less often. Thisresource is delivered from the control mechanism to the cache node likeany other cached resource—through the network of cache nodes.

As is apparent, an absolute journal with an approximate timestamp isused instead of an incremental journal with a sequence number. Alow-resolution timestamp is used to facilitate caching without incurringthe global synchronization and latency costs that a sequence numberwould impose on the system. This in turn means that a complete journalmust be used instead of an incremental one in order to ensure that ifthere is ever any news about a particular sector, the cache willeventually hear about it and not miss it indefinitely.

Pulling Sector and Property Journals

Each cache needs to keep track of the sectors and properties for whichit currently has cached content, along with the latest sector-level andproperty-level sequence number for each. Upon receipt of a new masterjournal, the cache checks the sequence numbers of sectors in the journalagainst its own sequence number for cached sectors. If the masterjournal indicates a more advanced sequence number for any cached sector,the cache node should preferably then issue a request for that sector'sjournal, specifying its current sequence number Ns for that sector:

GET/journal/sector/S?seq=Ns

This request returns a list of all known properties in the journal thathave been updated since sequence number Ns, annotated with the actualsector sequence number Ns′>Ns as well as the current property levelsequence number Np (as of sector sequence Ns′). If the sector leveljournal indicates a more advanced sequence number for any cachedproperty, the cache node should preferably then issue a request for thatproperty's journal, again specifying its current sequence number Np forthat property:

GET/journal/property/P?seq=Np

This request returns a log of all known resource invalidations in thatsector since sequence number Np, annotated with the actual sequencenumber Np′>Np. This process is repeated for each sector and property thecache cares about.

Sequence Number Rules for Invalidation

Since origin servers do not provide sequence numbers or other mechanismsthat can be used to synchronize their content updates with theinvalidation requests that arrive via other channels, there is thepotential for a race between the two effects on the state of the cachingnetwork. Therefore, for each resource in the cache, the cache tracks anduses the property-level sequence number according to the followingrules:

(1) When a cache receives new content for a previously uncachedresource, it sets the sequence number equal to zero (0). Thisconservatively ensures that any invalidations of this content thatarrive after this event will have the effect of invalidating theresource (assuming all sequence numbers are greater than zero), eventhough the cache has no information on the relative ordering between thenext invalidation and the refreshed content.

(2) When a cache retrieves a new property journal, and sees a sequencenumber N>0 in the journal for a resource that the cache already has inits cache marked with sequence number M, then:

-   -   if N>M, then the cache must invalidate the resource and set the        sequence number to N;    -   otherwise N≦M and the cache ignores the invalidation, leaves the        sequence number at M, and leaves the invalidation state of the        resource in the cache unchanged (it may be valid or invalid).

(3) When refreshing possibly stale (but otherwise valid) content, thecache optimistically maintains the same sequence number, N. Maintainingthe sequence number prevents invalidations that are known to haveoccurred after event(N) from re-invalidating the resource, since thesystem requires event(N) to have occurred before event(M) for all M>N,but the system has no information about the relative ordering betweenevent(M) and the refreshed content.

Certain control resources may need to be automatically refreshed uponinvalidation, because the content of the resource may affect the ongoingbehavior of the cache. For example, per-request processing in the cachemay be governed by handlers which are initialized according to customerconfiguration scripts that are loaded on first use only, and notre-consulted. Just invalidating such resources does not have the desiredeffect, because there is no GET request to force a cache fill, and evena cache fill would not be enough—in the case of Lua scripts, forexample, the content would need to be re-executed to cause any changesin the configuration to take effect.

Master Journal Caching

Each master journal is time stamped approximately, so a receiver of thejournal only knows that it is some control site's view of the sequencenumber of sectors in the system at some approximate time. Althoughdifferent observers of master journals do not have synchronized clocks,and since master journals are re-requested periodically and definecomplete views of all sector sequence numbers, the system allows anyview of a journal with time value T2>T (assuming common resolution) tobe used to satisfy any request to:

GET/journal/master?tval=T

This means a cache with one clock may cache a master journal responseunder some timestamp T2 (even though it was provided by some other nodewith a different clock), and the system may provide this cached responseto other nodes that make the request for any timestamp T<T2, even thoughthe requestors have different clocks, too.

For this to be maximally useful the system can prearrange to have cachenodes far from the control mechanism to have greater skew (at least asfar as the way they compute T values from their local clock value), withnodes close to the control mechanism having smaller skew, so that forany given T, a request for /journal/master?tval=T is likely to berequested by parents before their children. The net effect is a more orless orderly diffusion of newer journals from the control mechanism tothe edge.

Sector Journal Caching

Each sector journal request has a sequence number N which indicates thelast sequence number the client had received. A correct response to therequest:

GET/journal/sector/SID?seq=N

is any contiguous incremental journal which contains the one-stepincremental journal for sequence N+1. It may contain sequence numbersless than N, because the client will know to ignore them. It cannotstart at a value M>N+1 because this would lose possible updates thatoccurred at sequence numbers {N+1, N+2 . . . M−1}. It may stop at anyP>N+1, where P might not be the most recent sequence number based on thecurrent state, because the requestor is expected to eventuallyre-request the resource starting at sequence P.

This means that caches may cache a sliding window subset of the actualsector journal, and use this window to satisfy multiple distinct URLrequests. If the sliding window is sequence number interval [A, B] thenany request for sequence number K∈[A, B] can be served with the slice[K+1, B] from the cache. (Note: this means that, if K=B, the responsewould be empty.)

Sector Prefetch in Parent Cache Nodes

Each time a cache node refreshes its master journal, it notes all of thesectors mentioned in the master journal that have newer sequence numbersthan those of the sectors that it has cached, and it immediatelyrequests newer sector journals, and similarly for property journals,until it reaches the level of individual resource invalidations. In anembodiment, this behavior is common to all cache nodes, regardless ofwhat level in the caching hierarchy they reside, and the set of journalsthat will be retrieved is a function of the set of resources actuallycached at a particular node.

Parent cache nodes may go beyond this basic behavior and learn thebroader set of sectors and properties needed by their children, andprefetch them when indicated by a change in some higher level journal.For this to work, parent caches could be generalized to include not justthe leaf resources in the parent's local cache but also indicators ofthe sectors and properties for which child nodes may have resourcescached. This “extension” of the local cache can be treated as if it werea separate, LRU cache, with each child request of a resource for a givenproperty and sector resulting in a use of that sector or cache withrespect to the extension cache. Then, when the parent pulls a new masterjournal, the sector journals it requests in response should include notonly those indicated by its local cache but also those indicated by theextension cache.

It should be appreciated that to get the most out of this, parentsshould also realize when requests for new sector journals from a childoverlap with pending requests for sector journals from the next levelparent, and not re-issue redundant requests but fill the request fromthe pending request (but this is a general behavior expected of thecache for all resources, not just a characteristic of prefetching).

Analysis

A system using a control mechanism as described herein should satisfyone or more of the following:

Data are distributed through the system, from control site to controlsite, and from control mechanism to the edge, primarily in pull fashion.The main exception occurs in the distributed consensus protocol used inthe director core.

In an embodiment, every piece of information exposed by the controlmechanism, and everything the cache needs to implement its configurationand invalidation schemes, is exposed as a web resource. The controlmechanism's URI scheme represents a REST-ful web service abstraction ofthe control mechanism's underlying database and services.

In an embodiment, every piece of information exposed by the controlmechanism is preferably cacheable by the caching network. Control sitenodes also cache information from other control site nodes.

Sectors provide a way to partition the space of control information anddistribute it as close as possible to the neighborhood of the resourceswhich will likely need it, enabling locality of reference. Invalidationsare not broadcast to the entire caching network, they are justdistributed to those who care about the sector they live in.

The core is designed as a set of peer control sites which dynamicallyand fault-tolerantly self-organize into an inner (director) and outer(control) core, with no single point of failure. Individual controlsites also have no single points of failure, using standard techniquesfor the construction of high-availability web sites.

Although each control site is expected to be able to communicate withevery other functional control site, the expected communication patterndoes not require this. The number of sites in the control mechanism canbe increased to scale with increased number of sectors and propertieshandled by the caching network, and the size of the inner core can beseparately scaled to accommodate the size and update frequency of theinner control state (which grows much more slowly).

Most data are managed in eventually consistent fashion, and a minimalcollection of variables are managed in a strongly consistent way in theinner core. Furthermore, given the read-dominated and low-updatefrequency of the information in the inner control mechanism, theconsistency needed can be provided with a distributed consensus methodthat is simpler and less complex than a Paxos-based implementation.

Exemplary Control Mechanism Using Strong Consistency Requirements

An implementation of the control mechanism has been described thatrelaxes some consistency requirements, based on an understanding of thenature of the CDN. In some implementations however, the core mechanismmay make use of the stricter Paxos algorithm of Lamport and Gray as itsdistributed consensus algorithm. Implementations of this distributedconsensus algorithm are described, e.g., in one or more of: U.S. Pat.No. 7,856,502, titled “Cheap Paxos,” U.S. Pat. No. 7,797,457, titled“Leaderless Byzantine Consensus,” U.S. Pat. No. 7,711,825, titled“Simplified Paxos,” U.S. Pat. No. 7,698,465, titled “Generalized Paxos,”U.S. Pat. No. 7,620,680, titled “Fast Byzantine Paxos,” U.S. Pat. No.7,565,433, titled “Byzantine Paxos,” U.S. Pat. No. 7,558,883, titled“Fast Transaction Commit,” U.S. Pat. No. 7,555,516, titled “Fast PaxosRecovery,” U.S. Pat. No. 7,249,280, titled “Cheap Paxos,” U.S. Pat. No.6,463,532, titled “System And Method For Effectuating DistributedConsensus Among Members Of A Processor Set In A Multiprocessor ComputingSystem Through The Use Of Shared Storage Resources,” the entire contentsof each of which are hereby incorporated herein for the purpose ofdescribing the Paxos algorithm. It should also be appreciated that aparticular embodiment may use a partial Paxos implementation.

Various commercial implementations of the Paxos algorithm exist and areavailable. For example, Google uses the Paxos algorithm in their Chubbydistributed lock service (see, e.g., The Chubby lock service forloosely-coupled distributed systems, Burrows, M., OSDI'06: SeventhSymposium on Operating System Design and Implementation, Seattle, Wash.,November, 2006) in order to keep replicas consistent in case of failure.Chubby is used by Google's Bigtable (Bigtable: A Distributed StorageSystem for Structured Data, Chang, F. et al, in OSDI'06: SeventhSymposium on Operating System Design and Implementation, Seattle, Wash.,November, 2006) and other products. Microsoft Corporation uses Paxos inthe Autopilot cluster management service from its Bing product.Keyspace, an open-source, consistently replicated key-value store usesPaxos as its basic replication primitive.

Those skilled in the art will realize and understand, upon reading thisdescription, that other approaches and algorithms may be used instead ofor in conjunction with the Paxos algorithm.

Control Mechanism Requirements

An exemplary control mechanism for a CDN has been described.Modifications of the control mechanism are within the scope of thisdisclosure, and this section outlines the requirements of an exemplarycontrol mechanism as a guide to such modifications. It should beappreciated that a particular control mechanism may not satisfy all ofthese requirements.

The control mechanism acts as a distributed origin service for allcontrol information needed by the CDN. Preferred configurations of thecontrol mechanism should satisfy the following requirements for givenparameters NI, Linv, TCR, TCP, kR, kU, LU, and LR. (These parameters aredescribed below. It should be appreciated that although variousparameters are named and used here, these named parameters are onlyprovided to support this description and are not intended to imply anyactual parameters in any actual implementation or embodiment of acontrol mechanism or a CDN.)

Update Provide read/write access at human interaction speeds for up toNI concurrent administrative users and other interactive origin systemsat any number of distinct physical locations around the world for reviewand update of metadata, configuration files, and invalidations. Batchoperations are possible and may ultimately generate Linv (many thousandsof) individual resource invalidations per second. Other controlresources may also be required but are expected to change much lessfrequently. Read Latency Provide world-wide, low-latency (t < TCR) readaccess to control information for all nodes in the caching network. Thelatency is preferably well below the expected polling period of thecaching network (TCR 

 TCP). The manner in which control information is published for initialconsumption by the control interface of the caching network shouldfacilitate caching of whole and partial control resources inside thecaching network. Update When control data are updated, the notificationof that update should Notification preferably be available in all partsof the control mechanism with Latency expected latency of about the sameorder of magnitude as the polling period of the caching network. UpdateRead When control data are updated, a consistent version of the updatedLatency data should preferably be available to the caching network witha slightly larger expected latency (compared to the latency of thenotification). It is further expected that in preferred implementationsspatial locality of reference will ensure that only a small subset ofthe caching network will request the updated resources, and theserequests can be satisfied by control sites as soon as they have receivedthe update (they do not need to wait for the rest of the controlmechanism to absorb the update). Consistency At any given time, the viewpresented by a control site to the caching network should preferablycorrespond to a collection of consistent views of any independentportion of control state, as measured separately for each portion ofstate at some point in the past. In other words, every site in thecontrol mechanism is eventually consistent with every other site. ReadThe control mechanism should provide a view of control state thatAvailability effectively never goes down. Correct operation of thesystem should be preserved even in the face of up to kR concurrent sitefailures, for some fixed kR. Update The update service of the controlmechanism may have separate and Availability lower availabilityrequirements than the view service of the control mechanism (e.g.,tolerate up to kU concurrent site failures, for some fixed kU > kR.Network The system should have redundant network links to mitigate therisk Partition of a network partition. In the event of a networkpartition, however, the disconnected components should preferablycontinue to provide consistent read access to cache nodes that can stillreach them, but it is allowable to discontinue update access to isolatednodes until the partition can be corrected. It should be appreciated,however, that there is risk with such a situation; the responses fromthe isolated (subset) components should indicate to the requestor thatit is isolated and suggest an alternate location from which to retrievedata. If the edge can connect to that alternate control location (and ifsuch is not also in a minority), then the data from that alternate siteis preferably used. Here the ‘alternate’ location is part of the samecontrol mechanism, but a target believed outside the isolation thatincludes this control site. Automatic The system should preferablyautomatically recover whenever no Recovery more than the maximum sitesfail at the same time. This is really just a corollary to the aboveavailability requirements, but worth stating explicitly. Recovery ofindividual failed sites may require manual intervention in some cases,but is separate from the automated recovery of the remaining functionalnodes in the system. Throughput The system should preferably be able toprocess up to LU read/write Capacity requests per second fromadministrative/operational clients, and up to LR read requests persecond from the caching network, for some fixed load maximum loads LUand LR. Automatic Load The control mechanism should preferably be ableto automatically Balancing balance the load of control resource requestsfrom the caching network. Overloaded control sites will be detected anda portion of their workload will be transferred to other less busycontrol sites without manual intervention.

In addition, the architecture of the control mechanism should preferablysatisfy the following requirements which address how the properties ofany given instance or configuration of the control mechanism may bechanged via incremental reconfiguration:

Linear Throughput should preferably be able to scale linearly with thescale Throughput of the CDN by adding new directors and control sitesand Scalability reconfiguring, without affecting the resulting controlmechanism's ability to satisfy its latency requirements. For example,doubling the worldwide number of properties or doubling the worldwideinvalidation rate is preferably, feasible to handle by approximatelydoubling the number of directors and/or control sites in the controlmechanism, without reducing performance of any of control mechanism'soperations as perceived by read/write users or the caching network. HighAvailability The control mechanism should provide a view of controlstate that effectively never goes down. Specifically, it should bepossible to configure the system in advance so that an arbitrarily largenumber of control mechanism nodes can fail at once without affecting thecorrect operation of the system as expressed by the requirements above,with the exception of throughput capacity (which may be temporarilyreduced by site failures).

Operation Request-Response Processing

In operation, the various CDN caches (and other services) receiverequests for resources, processes those requests, and provide responses(which may include, e.g., the requested resources, error messages, ordirections to find the resources elsewhere).

FIGS. 3-E and 15 show the request-response operation of an exemplary CDNcomponent 1102. Although component 1102 is denoted “Server” in thedrawing, it should be appreciated that component 1102 may be a cacheserver or any other component or service of the CDN that performsrequest-response processing. As shown in the drawing, client 1103 makesa request for a resource of server 1102, and receives a response to thatrequest. In processing that request, as explained below, the server 1102may obtain information from one or more other data sources 1110. Some ofthese data sources 1110 may be other CDN components (e.g., caches 1112or control mechanism(s) 1116). The data sources 1110 may also includeorigin server(s) 1114 that may or may not be part of the CDN. It shouldbe appreciated that the client 1103 may be another CDN component (e.g.,a cache) or it may be a client entity that is external to the CDN. Thus,with reference again to FIG. 13-C, the requested resource may be acustomer resource 124 or a CDN resource 126.

The server 1102 preferably supports HTTP/1.0, and HTTP/1.1, and HTTPSrequests, although it is not limited to those protocols or to anyparticular version of any protocol. HTTP/1.1 is defined in NetworkWorking Group, Request for Comments: 2616, June 1999, “HypertextTransfer Protocol—HTTP/1.1,” the entire contents of which are fullyincorporated herein by reference for all purposes. HTTPS is described inNetwork Working Group, Request for Comments: 2818, May 2000, “HTTP OverTLS,” the entire contents of each of which are fully incorporated hereinby reference for all purposes. Unless specifically stated otherwise,“HTTP” is used in this description to refer to any version or form ofHTTP request, including HTTP and HTTPS requests. Those of ordinary skillin the art will realize and understand, upon reading this description,that HTTPS may be preferred in situations where additional security maybe required. It should also be appreciated that when an HTTP request isreferred to herein, some other protocols, including possibly proprietaryprotocols, may be used while still leveraging the CDN and using URLs toname the objects.

The server 1102 includes a request/response mechanism 1104 (preferablyimplemented by software in combination with hardware on the server1102). The request/response mechanism 1104 listens for connectionrequests on multiple configured addresses/ports, including port 1106.

It should be appreciated that there are two types of requests describedhere. First, the server 1102 listens for connection requests from otherdevices (e.g., from client 1103). These requests are used to establish aconnection (e.g., a TCP/IP connection) between the client 1103 and theserver 1102. The second type of requests is those made by the clientover the established connection (e.g., HTTP requests or the like).

Once a connection from a client is established, the request/responsemechanism 1104 waits for a resource request (e.g., an HTTP request) onthat connection. When a resource request is made, the request/responsemechanism 1104 tries to identify a customer associated with thatrequest. As used here, a “customer” is an entity that is authorized tohave its content served by the server 1102. The customer may be anexternal entity such as, e.g., a subscriber to the CDN, or the customermay be another CDN component. In effect, the request/response mechanism1104 needs to determine if the requested resource belongs to a propertyfor which the system is configured to provide service.

In order to determine whether or not the request is associated with acustomer of the CDN (or the CDN itself), the server 1102 needs at leastsome information about the CDN's customers. This information may bestored as global data 1108 in a database 1106 on the server 1102 (globaldata 1108 corresponds to global data 128 in the cache database 120 inFIG. 13-C). The global data 1108 should include sufficient data to allowthe server 1102 to either reject the request (in the case of a requestfor a resource that is not associated with a customer), or to serve therequested resource to the client 1103, or to direct the client toanother source from which the requested resource may be obtained orserved. If the server 1102 does not have the required global data 1108at the time of the client request, it may obtain the needed global data1108 from a data source 1110, preferably from a control mechanism 1116or from another cache 1112. In effect, for certain internal CDN data,the control mechanism is considered an origin server or coserver.

As explained below, the request/response mechanism 1104 may performcustomer-specific processing as part of the request/response processing.In order to perform customer-specific processing, the request/responsemechanism needs certain customer-specific data 1111 (which correspondsto customer specific data resources 130 in the cache database 120 inFIG. 13-C). If current customer-specific data 1111 are not available inthe request/response mechanism's database 1106, the server 1102 mayobtain the needed customer-specific data 1111 from a data source 1110,preferably from a control mechanism 1116 (although customer-specificdata may also be obtained from another cache 1112 in the CDN).

Request collections (described above) may be used to implement aspectsof request-response processing.

Those of ordinary skill in the art will realize and understand, uponreading this description, that the database 1106 may be in any form,including one or more tables stored in one or more files, preferably inthe server's memory.

Objects, Sequencers and Handlers

In some implementations, the processing performed by request/responsemechanism 1104 may use various kinds of objects, including a NotesObject, a Session Object (sxn), and a Transaction Object (txn). Withreference to FIG. 15-A, a Notes Object 1204 is a generalized stringkey/value table. (A Notes Object may also be referred to as a PropertiesObject.) FIGS. 15-B to 15-C show a Session Object (sxn 1206) and aTransaction Object (txn 1208), respectively. A session object 1206contains information about a particular client session, e.g., a clientconnection or an internally launched (or spawned) session. A SessionObject 1206 may contain allocation context information for a session. ATransaction Object (txn 1208) is usually associated with a session andcontains information about an individual request. During a session,multiple transactions may be performed, and information about eachtransaction is carried in a separate transaction object. E.g., atransaction object carries the request to be satisfied, room for theresponse, information about where the response body is coming from(e.g., response channel id, defined below), etc.

A sequencer is essentially a task. A sequencer uses a sequence controlobject made up of an ordered list of one or more handlers and handlerargument(s). FIG. 15-D shows an exemplary sequence control object 1301comprising handler(s) 1302 and handler argument(s) 1304. The handler(s)1302 comprise the ordered lists of handlers 1302-1, 1302-2 . . . 1302-n,and the argument(s) 1304 are per handler (denoted 1304-1, 1304-2 . . .1304-n). It should be appreciated that not all handlers requirearguments (the arguments are shown in dashed lines in the drawing inFIG. 15-D). It should also be appreciated that some handlers may obtainsome or all of their arguments from other locations. It should also beappreciated that a sequence control object may have only a singlehandler (i.e., a sequence control object may consist of a single step).

When running, a sequencer invokes its handlers (essentially, processingmodules) in order. By default, sequencers are bidirectional, so that thesequencer's handlers are called (invoked) in order on the way “in” andin reverse order on the way “out”. Handlers can modify the sequence,thereby providing flexibility. FIG. 15-E shows the execution of thesequence of handlers 1302 from sequence control object 1301 (of FIG.15-D). As shown in FIG. 15-E, the sequencer invokes the handlers in theorder “Handler #1,” “Handler #2,” . . . “Handler #n” into the sequenceand then in the reverse order out of the sequence. So “Handler #1” makesa request of “Handler #2”, and so on, until “Handler #n”, and thenresults are passed back, eventually from “Handler #2” to “Handler #1”.Each handler is invoked with its corresponding arguments (if any).

Handlers may be synchronous or blocking. Handlers may inspect and modifythe sequence to which they belong, and handlers may launch their ownsequencers (or sequences). There are two forms of this process: one iswhere a handler launches a “subsequence”. That subsequence runs in thesame sequencer as the handler and the sequence the handler is in issuspended until the subsequence is complete. Another example occurs whena handler launches a complete sequencer. In that case, the sequencer isa separate, independent task. A powerful aspect of that model is that ahandler could launch such a sequence on the way in to the sequence,allow processing to continue, and then pick up the result (waiting ifnecessary) on the way out of the sequence. FIG. 15-F shows an example ofa first sequence (“Sequence 1”) in which a handler (Handler #2, 1302-2)launches (or spawns) another sequence (“Sequence 2”, consisting ofHandler #2,1 1302-2.1 . . . Handler #2,k 1302-2.k). If Sequence 2 runsin the same sequencer as the handler #2, then handler #3 (of sequence 1)will not begin until sequence 2 is complete (i.e., until handler #2,k isdone and the response returned to handler #2). If, on the other hand,sequence 2 is launched as an independent and separate task, sequence 1can continue with handler #3, etc. without waiting for sequence 2 tocomplete.

FIG. 15-G shows an example of a first sequence (“Sequence 1”) in which ahandler (#2) launches two other sequences (Sequence #2,1, and Sequence#2,2). The Sequence #2,2 launches a subsequence #2,2.1. Sequence #2 mayhave to wait for the launched sequences (#2,1 and/or #2,2) to completeor it may continue and pick up the results of those sequences on the wayback out of the sequence.

A handler's behavior may be classified into three broad groups (ortypes):

-   -   One-shot: The handler is removed from sequence when done.    -   Intelligent: The handler may manipulate the sequence.    -   Persistent: The handler is called on the way “in” and “out”.

These labels are used as descriptive shorthand for basic types ofhandler behavior, and it should be appreciated that this type is notused by the sequencer, and nothing needs to enforce a handler's “type,”and a handler may act differently depending on circumstances.

Handlers may be named, and it is useful to name them to correspond tothe functions that they are to perform (e.g.: “ssl”, “http-conn”,“http-session”, “strip-query”, “proxy-auth”, etc.).

A sequence control object may be stored in compiled form for re-use, sothere is no need to constantly look up handler names.

The following is an example of a sequence specification for an HTTPlistener:

  listener = { address = “*.80”, sequence = “http-conn, http-session” }

In this example, the handlers are “http-conn” and “http-session”, andthe parameter for the listener task is “address=‘*.80’”. A sequencecontrol object 1301′ corresponding to this listener sequence is shown inFIG. 15-H. This listener task provides a bare TCP or cleartextconnection. The first handler (“http-conn”) is a one-shot handler whichcreates an HTTP connection from a cleartext connection. The secondhandler (“http-session”) is an intelligent handler that takes the HTTPconnection (as already created by the “http-conn” handler), creates asession object and handles the entire session. It should be appreciatedthat the listener is just providing the communication channel to theclient, and the same basic listener code could be used with differenthandlers to implement protocols other than HTTP (e.g., FTP).

As another example, the following sequence specifies a general SSLlistener:

  listener = { address = “*.443”, sequence = “ssl, http-conn,http-session” }

In this example, the handlers are “ssl”, “http-conn” and “http-session”,and the parameter for the listener task is “address=‘*.443’”. A sequencecontrol object 1301″ corresponding to this SSL listener sequence isshown in FIG. 15-I. The listener task accepts a connection and thenlaunches whatever sequence was specified for the listener. This sequenceis similar to the HTTP listener (above), except that the SSL handlerfirst creates an SSL channel on the bare (encrypted) connection,suitable for the http-conn handler. Although the SSL handler is a“one-shot” handler, it needs to block since it must perform the SSLnegotiation. That is, the “ssl” handler must complete before the nexthandler can begin. The SSL handler is responsible for instantiating anSSL channel. It should be appreciated that although the SSL channel ispersistent, the handler which sets it up does not need to be persistent.The “ssl” handler instantiates an SSL channel on top of the cleartextchannel. Once that is done, the SSL channel (which does the decryptionand encryption) persists until the connection is finished, even thoughthe “ssl” handler itself is gone from the sequence. So the “ssl” handleris not performing the SSL operations itself, it is just enabling them byinstantiating the necessary channel.

FIGS. 16-A to 16-D show examples of sequencers and handlers.

As shown above, a sequence may be used to interpret a request and get tothe point that a response is available to be pumped. The same basicsequencing mechanism can be used to implement a programmablepump/filter, although of course the handlers themselves are nowperforming a different task. FIG. 16-A shows a bidirectional sequencethat is part of a pump/filter. The pump task uses “direct delivery”requests, e.g., sendfile( ), because it does not need to see the dataitself. It should be appreciated that sendfile( ) is not the request, itis just one way a direct delivery request may be implemented by thechannel involved. The delivery sequence consists of two handlers:

-   -   delivery-monitor (account bytes delivered, monitors        performance); and    -   chan-submit (submits request to a channel, waits for response).        The channel may be, e.g., an object channel, downstream channel,        etc.

If the process requires, e.g., computation of a message digest (such asMD5) of the pumped data, the sequencer can be set up with an MD5 handlerin the path (e.g., as shown in FIG. 16-B). The MD5 handler can be usedto snoop or verify the data as it passes.

An example of a self-modifying sequence is shown in FIG. 16-C. The pumptask is using direct delivery requests, so the data are not available inuser space. The MD5 handler sees the request on the way “in” to thesequence and inserts a new handler (“direct-to-buffered”) handler to the“left” of the MD5 handler so that it runs before the MD5 handler. The“direct-to-buffered” handler translates direct delivery to bufferedread/write.

A sequence can be modified to change direction of the order ofoperations. For example, in a case where direct delivery requests can betoo large for a single buffered read/write, the “direct-to-buffered”handler can change the sequence direction to perform multiple operationson one side of the sequence (e.g., as shown in FIG. 16-D). Handlers tothe left of the “direct-to-buffered” handler still see what they expectto see, while handlers to the right of the “direct-to-buffered” handlerperform multiple operations.

Scripts and Customer-Specific Control

As noted, the request/response mechanism 1104 (FIG. 15-) may performcustomer-specific and/or property-specific processing as part of itsrequest/response processing. The request/response mechanism needscertain customer-specific data 1111 in order to perform thecustomer-specific processing.

Preferably the system has a default mode in which it will performrequest/response processing without any customer-specific handlers. Thatis, there is preferably a standard or default request/response sequencethat a content provider may use. The request/response mechanism 1104 mayallow customer-specific handlers (or sequences) to be included atvarious locations (or hooks) during the request/response processingsequence. Customer-specific sequences and/or handlers and/or rules maybe stored in the database 1106 on the server 1102 as part of thecustomer specific data 1111. These customer-specific handlers mayperform operations on the request and/or response paths. Thecustomer-specific scripts that are to be used to process a customer'srequests are referred to herein as Customer Configuration Scripts(CCSs), and are associated with the customers, e.g., via customer ids.With reference again to FIG. 13-C, a CCS may be considered to be acustomer specific data resource 130. Preferably the system has a defaultmode in which it will perform request/response processing without anycustomer-specific handlers. That is, preferably customer-specifichandlers are optional.

It should be appreciated that scripts are not the same as sequences. Ascript is used to specify the sequences to be used to handle requestsfor a particular customer. The script may perform whatever operations itneeds (including making its own HTTP requests, etc.) to determine whatthe sequences should be. For example, a script may also use a differentsequence depending on the local environment. However, once the scripthas done that job, the resulting sequences are used (preferably withoutrerunning the script) until something happens (e.g., the script isinvalidated and reloaded) which indicates different sequences are nowneeded. Note, however, that a given handler may be implemented as arequest/response script in the same language as the configurationscript, but performing a different job.

Customers may provide handlers, parameters for existing handlers, orroutines to be invoked by handlers at certain stages of the processing.

It should be appreciated that since, as noted, the client 1103 mayitself be another component of the CDN (e.g., a cache or a controlmechanism, etc.), the CDN itself may have CCSs associated therewith.That is, from the point of view of request /response processing, the CDNmay be considered to be a customer of itself.

With reference again to FIG. 15, in order to process the request, theserver 1102 will need the CCS for the customer associated with therequest from the client 1103. The CCS is stored in the database 1106,corresponding to at least some of the customer-specific data 1111. Ifthe server does not have that customer's CCS stored locally at the timeit is processing the client's request, the server 1102 will attempt toobtain the CCS from another data source 1110, typically from a controlmechanism 1116 or a peer (e.g., one or more of the caches 1112). If aCCS is found, any customer-specific handlers (or sequences) specified inthe CCS will be included in the appropriate locations (hooks) duringrequest/response processing.

In summary, the CCS generally is run once (unless invalidated orpurged). The CCS defines the customer-specific sequences, which are thencached in the server 1102 in their compiled form. If those sequences arepresent and valid, they are used without re-running the CCS (see the“Valid sequences?” decision in the flow chart in FIG. 20-A, discussedbelow).

A CDN component's handling of a resource request is described withreference to the flowchart in FIG. 17. It should be appreciated that theCDN component may be any entity in the CDN, including a cache (e.g., anedge cache, a parent cache, an origin cache, a control mechanism, etc.),and the requested resource may be any resource, including resourcesrequested by clients external to the CDN on behalf of customers orsubscribers to the CDN and resources that are requested by other CDNcomponents and comprise CDN data (e.g., log files and the like).

First, the cache obtains a resource request (at 1510). The request maybe using an HTTP request, and include information in an associated HTTPheader. The cache needs information in order to determine whether therequested resource can be served. This information is available from theGCO. The GCO includes information that will allow the cache to determinewhether the requested resource corresponds to a resource of a customerof the CDN (or to a CDN resource). Essentially the cache may use the GCOto determine whether the requested resource belongs to a propertyconfigured to use the CDN. The cache therefore obtains a current versionof the GCO, if needed, (at 1512) and determines (at 1514) whether or notthe resource can be served. If the cache needs the GCO or otherinformation from the control mechanism, the cache can request thatinformation using appropriate HTTP (or FTP) request(s), and the cachemay obtain the GCO and/or other needed information from the controlmechanism and/or other caches or other locations in the CDN. Forexample, FIG. 18 shows various caches (102-1, 102-2 . . . 102-5) pullingdata from the control mechanism 108 using an HTTPS pull. In order toinitiate such a pull, a cache would make an HTTPS request for the data(using a URL of that data) and identifying the control mechanism 108 asthe source of the data. In the example shown in FIG. 18, caches 102-4and 102-5 pull a CDN property from the control mechanism 108, whereascaches 102-1, 102-2, and 102-3 pull the CDN property from other caches(102-4 and 102-5).

The cache server should serve a particular customer's resource to aclient in accordance with the processing requirements (e.g., scripts,etc.) set by that particular customer, the cache therefore needs the CCS(if any) associated with that customer. The CCS may specify processingrequirements etc. on a per property basis. Accordingly, at 1516, thecache server obtains the CCS (if any) associated with the requestedresource (i.e., with the customer on behalf of whom the requestedresource is being served). It should be appreciated that the CCS ispreferably, but not necessarily, pulled prior to obtaining the resource(since the CCS must be processed before in order to retrieve theresource).

If the cache determines (at 1514) that the requested resource can beserved (i.e., that the cache is authorized to serve the resource), thecache may need to obtain a copy of the resource (at 1518). The CCS (andpossibly information associated with the request, e.g., HTTP headerinformation) should provide the cache with sufficient information for itto locate a copy of the resource, if needed. The cache server may obtainthe requested resource from another cache (e.g., a peer) or from anorigin server. In some embodiments the cache server may redirect theclient to another location from which to obtain the content.

Having obtained the appropriate CCS (if one exists), the cache serverthen serves the resource (at 1520) using information in the CCS. Asexplained, the CCS preferably runs before the cache even obtains theresource to serve, since the CCS may program handlers at hook pointswhich affect the request itself, and therefore which affect whichresource is going to be served.

It should be appreciated and understood that the CCS for a particularcustomer is not run on every request associated with that customer.Unless or until invalidated, a particular CCS is only run once in acache to set up the required sequences for processing that customer'sproperties. A CCS configures the cache to process an associatedcustomer's properties, and those processes need not be reconfiguredunless the CCS changes or expires or is invalidated.

Component Roles

Certain components of the CDN system may act as clients of the CDNand/or as content providers to the CDN. For example, as noted above, thecore control cluster maintains information used/needed by the caches inorder for them to deliver content to clients. When caches obtaincontrol-related content (resources) from the control mechanism cluster,the control mechanism cluster is acting as a content provider and thecaches are acting as clients. Similarly, when a collector mechanismobtains log and other information from a cache cluster, the collectormechanism is acting as a client and the cache cluster is acting as acontent provider. In addition, when the control mechanism clusterobtains information from a collector mechanism, the control mechanismcluster is acting as a client and the collector mechanism is acting as acontent provider. When content is being delivered by the CDN to clientson behalf of a content provider, the caches obtain that content fromorigin server sites associated with the content provider. In some cases,as noted above, a cache server site may try to obtain requested contentfrom another cache server site (e.g., from a peer cache server site orfrom a parent cache server site). In those cases the peer (or parent)cache server sites are acting as content providers.

Hierarchy

The CDN preferably uses tree-like hierarchical communication structuresto pull data from the control mechanism and origin servers to the edge,and to pull data from the edge to specialized gatherers and monitors(reducers and collectors). These tree-like structures are preferablydynamic, i.e., they can change with time, requirements andcircumstances. These structures are preferably also customized, i.e.,different communication operations can use different hierarchies, anddifferent instances of a communication operation may use a differenthierarchy (e.g., different parents for different origin servers).

For pulling data to the edge, each node preferably knows its parent orparents. For pulling data to the root, each node also preferably knowsit's children. Lists of parents or children can themselves be resources.Using domain names instead of IP addresses for parents and childrenallows the rendezvous system to be leveraged.

Executable Resources, Customization Hooks and Scripts

Caches 102 in the CDN 100 are able to process and deliver (serve)executable resources, and CDN users (e.g., content providers, the CDNitself) are able to provide extensions to resources via these executableresources. Executable resources provide a general and useful extensionthat may replace and/or enhance several ad hoc mechanisms and HTTPextensions in a CDN. Executable resources allow suitably authenticatedHTTP servers to respond to an HTTP request with a new type of reply(possibly identified by an extension status code such as “600 Exec” or anew Content—Type, e.g., say “application/x-fp-exec”). The contents ofsuch a reply are a script to be executed by an interpreter in theresponse path of the cache, in order to generate the actual reply.Examples of things the interpreter may do are:

-   -   Fill the request from an alternate location.    -   Fill the request from multiple locations and merge the results.    -   Perform authentication.    -   Pre-fill one or more other resources.    -   Perform manipulations on the body of a resource (e.g.,        compression, transcoding, segmentation, etc.)

If the reply is cacheable, it may be retained by the cache, and executedeach time the resource is requested.

The NDC may use this feature to gather logs.

The system provides a way to distinguish between requesting the scriptitself, and requesting the result of executing the script. Scripts aresubject to pinning, expiration, invalidation and revalidation just likeany other resources.

Customer-specific code can be added at numerous hook points in theprocessing. Such customer-specific code may be used, e.g., for:

-   -   request manipulation after parsing;    -   calculation of cache key for index lookup;    -   coarse and fine details of authentication;    -   content negotiation choices, variants, and encodings;    -   policies for range handling;    -   deciding which peers to contact or migrate to;    -   which host(s) to contact for fills;    -   contents of fill request;    -   manipulation of fill response;    -   handling of origin server errors;    -   caching policy;    -   manipulation of response to client;    -   logging effects.

A wide variety of hook points enable CDN users (customers) to modifyexisting algorithms; pre- or post-process algorithms; and/or completelyreplace algorithms. In a presently preferred embodiment, these are thecustomer-specific sequences which are set at various hook points by theCCS. It should be appreciated that the hook points need not behard-coded into the system. They may be considered in some cases, toexist conceptually when reasoning about where to place handlers in thecompiled sequence, but they are an artifact of a particular way ofcoming up with the processing sequence, and not necessarily the onlyway.

In a present implementation, scripts can be used for:

-   -   Configuration    -   Customer-specific event handling and HTTP rewriting    -   Network Data Collection operations    -   Rapid prototyping of new features

Scripts are preferably cached objects (like other objects in the CDN).They are preferably compiled into byte code and executed in a sandbox bya virtual machine. Scripts are preferably measured for CPU usage and areeffectively preemptible.

In a presently preferred implementation scripts are implemented usingthe Lua scripting language. Lua compiles into bytecodes for a smallregister-based (as opposed to stack-based) virtual machine. Lua'sprimary data type is a table (which is implemented as a hybrid between ahash table and an array), but it also has other types (string, number,Boolean, etc.). Lua's interface to the rest of the system is via variousfunction bindings which are a means for a Lua function call to cause asystem function (instead of another Lua function) to be called. Thedetails of a particular binding, including the data it operates on andthe results it returns to the Lua script, are specific to the binding inquestion and may involve tables (e.g., hash table objects) or othertypes of objects.

Those of ordinary skill in the art will realize and understand, uponreading this description, that a different scripting language could beused. However, it should be appreciated that any scripting languageshould run (e.g., be interpreted) quickly with a small interpreter, havea relatively small implementation, be lightweight (have a small memoryfootprint and be easily sandboxed for secure execution) and providesufficient control to allow customer-derived scripts to be used. Itshould be noted that “script” does not necessarily imply interpreted atrun time, but rather it is used in a broader sense to mean loadablecode.

It should be appreciated that basic cache functionality requires noscripts, and the CDN will operate without them to serve content. Hooksallow script execution at various points in the cache's processing pathand may be used (if permitted) to enhance and modify content delivery.

Hooks may be either:

-   -   Customer-visible. Monitored, accounted, billable.    -   Ops-visible. Monitored.    -   Development-visible. Minimally restricted.

At hook points, one can specify either:

-   -   A canned (predefined) algorithm name; or    -   An expression (e.g., an in-line script or an expression in the        script language); or    -   A handler or series of handlers; or    -   The name of a script

In some implementations, scripts used in request processing may:

-   -   Inspect the request    -   Modify the request    -   Generate a response (including replacing an already generated        response)    -   Provide a short static body    -   Provide a function to incrementally generate longer response        body    -   Provide a function to filter a response body    -   Inspect an already generated response    -   Modify an already generated response    -   Launch any number of helper requests        -   Synchronously—wait for and inspect response        -   Asynchronously—“fire and forget”        -   Cacheable or non-cacheable

Configuration variables similarly support script execution, e.g., avariable can have an immediate value, be a parameter reference, ordetermined by an inline expression. For example, the variable fill_hostis shown here with different types of values:

-   -   fill_host=“origin.customer.com”—immediate value    -   fill_host=$host1—parameter reference    -   fill_host=“origin”.domain($request host)—inline expression    -   fill_host=http://origin.customer.com/scripts/pick_origin.lua—reference        to a script

It should be appreciated that these values are given only by way ofexample of the type of values. These expressions will preferably be inthe script language (e.g., Lua).

Cache Organization

FIG. 19 is a block diagram showing the major functional modules(collectively 1900) in an exemplary cache service. These modules includeExecutive 1904, manifest channel 1906, global strategizer 1908, outgoingconnection manager 1910, fill manager 1912, HTTP parsers 1914, 1915,HTTP formatters 1916, 1917, incoming connection manager 1918, rewriter1920, index 1922, store manager 1924, peer manager 1926, IO 1928,inter-cache transport protocol 1930, and rulebase 1932. These modulesand their operational connectivity are shown by way of example, and itshould be appreciated that a cache may include different and/oradditional modules, and that the modules in a cache may have differentoperational connectivity.

The Executive 1904 is the basic executive controlling all activitieswithin the cache. The Executive's responsibility is to maintain aprioritized list of runnable tasks, and execute them in a priorityorder. A high-priority “system” task repeatedly checks for ready filedescriptors, and moves their waiting “user” tasks onto the run list. TheExecutive may also support abstracting a task or group of tasks as anasynchronous service called a channel, and may provide a clean way fortasks and channels to communicate. Cache subsystems discussed below areimplemented as tasks and channels.

When a new client connection is detected on one of the listener filedescriptors, the Incoming Connection Manager 1918 assigns a client taskto handle it, and coordinates the process of accepting the connection,completing any TLS (Transport Layer Security) handshake, and assigning apriority and connection-level policy. The Incoming Connection Manager1918 continues to monitor and manage the connection throughout itslifetime.

Although the Incoming Connection Manager 1918 is described here as asingle component, it should be appreciated that this is merely onelogical depiction of functionality in the cache. E.g., in a presentimplementation there is a listener task which, after receiving a newconnection, runs a sequence of handlers which are configured for thatparticular listener. Those handlers may apply policies, perform a TLSupgrade if appropriate, etc.

The client task invokes the HTTP Parser 1915 to read data from theconnection, locate the message boundaries, and parse the HTTP into arequest object with a convenient internal format. Messages may remain inthis internal format as long as they are within the cache system (theCDN), even if they are migrated to another cache. It should beappreciated that cache-to-cache messages may be in other formats, e.g.,in some cases, messages may be sent from cache-to-cache in theirstandard text format.

The request object may next be processed by the rulebase 1932, to assigncustomer-specific handling policies and normalize the URL associatedwith the request. The policy might indicate, e.g., that the requestrequires manipulation by a customer-defined script. In that case, therequest rewriter 1920 executes the script. In a present implementation atable (the GCO) is used, in conjunction with the apparent target of therequest, to decide whether or not it is worth it to continue furtherprocessing at all (i.e., whether the request is associated with a validcustomer). At this point, the system checks whether there is aprogrammed sequence of handlers appropriate for that customer. If not,the system retrieves and runs the Customer Configuration Script (CCS),whose function it is to program the sequence of handlers. Then thehandlers are run to process the request.

The next step is to determine if the cache has any information about therequested object. The request is presented to a manifest channel whichthen inspects the request and uses the information it has internally (amanifest) to determine how best to handle the request, including byproviding a reference to a cached object, requesting a fill or arefresh, etc. The manifest channel maintains the manifest data and alsoprovides the intelligence to use the manifest data. The URL is looked upin the cache index 1922, which is essentially a database listing theobjects already in the cache. The result of the index lookup is eithernull, or a manifest listing all the data, metadata and ongoingactivities that might be relevant in responding to the request.

At this point, the request processing engine has a set ofrequest-specific information, comprising the parsed request, a set ofpolicies for handling the request, and a manifest of pertinent cacheinformation. As noted, a manifest channel 1906 is responsible fordetermining how to respond to the request. In general, the decision willdepend on the request-specific information, the object-specificinformation, the current state of the machine, the global state of theCDN, and the set of capabilities implemented in the cache. There may beone strategizer instance running for each actively referenced manifestin the cache, and that strategizer handles all clients and activitiesreferencing that manifest. In a current implementation the strategizeris the manifest channel.

The manifest channel 1906 has at its disposal a variety of modules,implementing services, the services including the storage service, fillservice and peering service. Other modules may be available for errormessage generation, authentication, logging, throttling, etc. The roleof the strategizer is to orchestrate these services to construct a replyto the request, and preferably to fully process the request (sincelogging is part of the processing but not necessarily part of thereply).

The manifest channel 1906 contains much of the intelligence in thecache. New capabilities may be added and special handling provided inthe manifest channel 1906 for new classes of resources. For this reason,the architecture is designed to provide clean separation of mechanismand policy. Machinery/mechanisms implementing individual services areencapsulated into separate modules, and the manifest channel 1906essentially acts as a conductor, supervising the construction of aresponse.

The most common scenario is expected to be a simple cache hit, where thecache has an easily accessible copy of the requested object. In thiscase, the manifest channel 1906 invokes the storage service (storemanager 1924) to retrieve the object, which may be in memory (generallydenoted 1934), or on solid-state or hard disk (generally denoted 1935).In the process, the manifest channel 1906 may also provide guidance tothe storage service (store manager 1924) on what type of future accessis expected, so that the object can be optimally placed in theappropriate type of store.

Another common scenario involves a dynamically-generated response, suchas a response to a control command, a statistics report, or an errormessage.

When a request is received, an initial sequence of handlers is assembledto handle the request (based on the target of the request and thelistener it came in on). The handlers either generate a response becausethe request is directed at them, add some value by performing a requestor response manipulation, or take themselves out of that instance of thesequence because they are not relevant to the request at hand. A handlermay be a script handler, and that script can perform any number offunctions (as outlined previously) to generate a response or tomanipulate a request or response. The “manifest channel” is onecomponent used by a series of handlers, but it is concerned with dealingwith cacheable resources. It is generally not involved in determiningwhether, e.g., pre-authentication needs to be performed (which could behandled by a handler in the cli-req hook or similar).

As noted earlier, an important aspect of the architecture is thatessentially all data items, including machine configuration, customerpolicies, logs, billing data and statistics, are simply web objects,which appear in the index and are retrieved through the strategizer justlike customer web resources. As critical resources, they do havepolicies engaging specific authentication, persistence and prefillingservices, but the machinery of these services is also available toordinary resources when necessary.

A feature of Unix file I/O is that read and write operations on standardfiles are synchronous, and will block the calling thread if the dataneeds to be physically retrieved from or written to disk. Since thecache likely has plenty of other work to do while disks are beingaccessed, the IO library 1928 provides a way for the cache to hand offdisk I/O to a separate thread that can block without holding up thecache activities. In addition, the IO library 1928 provides a richer,more efficient API to the physical disks than the normalopen/read/write/close interface.

If the request is not a cache hit, the manifest channel 1906 willtypically invoke the peering service (peer manager 1926) to see if anearby cache has the requested object. Since other services may alsoneed to communicate with neighboring caches, and it is inefficient toopen or operate multiple TCP connections to multiple neighbors, aninter-cache transport protocol module 1930 multiplexes various types ofinter-cache communication over a single general-purpose link. Forinstance, the peering service might offer to migrate the clientconnection to a neighbor that has the resource; the strategizer couldchoose to use this option, in which case it would invoke the migrationservice, which would use the inter-cache transport protocol to transferthe client connection state. As before, it should be appreciated thatone or more handlers perform this function.

If the request is not a hit, or internally serviced or migrated, theresource needs to be fetched via the network, and the fill service (fillmanager 1912) is invoked. The fill manager's role is to balance andprioritize the outgoing network activity between all strategizers, andoperate protocol handlers for the supported set of protocols. Inparticular, for HTTP fills, the strategizer will create an HTTP fillrequest in internal format, and the fill service will format thatrequest using the HTTP formatter 1916, send it to the appropriate targethost, and manage the data transfer. For efficiency, connections arecreated and managed by an outgoing connection manager 1910, whichmaintains a pool of connections to frequently accessed hosts, tracksresponsiveness, implements traffic shaping, etc. In a currentimplementation, the manifest channel creates the fill request.

Some fill operations will be peer fills from other caches, and theselikely constitute the main class of inter-cache communication not usingthe Inter-cache Transport Protocol. Such fills may use the internalmessage format and bypass unnecessary HTTP formatting and parsing steps.

Fill responses arriving from the network are handed back to the manifestchannel 1906, which decides whether to cache the object, and how toprocess it before replying to waiting clients.

It should be appreciated that the manifest channel 1906 would not invokea “reply rewriter.” Rather, such a rewriter (if any) would exist at oneof the hook points on the response path, e.g., client-resp, and would beused regardless of whether a manifest channel was involved in generatingthe response. Such a rewriter may inspect the response to determine ifit came from cache, however it is not up to the manifest channel toinvoke this rewriter. The manifest channel would not generally beinvolved in a request which was a priori known to be non-cacheable. Onthe other hand, a “reply rewriter” may well be involved in such arequest.

As on the input path, the manifest channel 1906 invokes appropriateservices to do the actual work, and supports optional processing by areply rewriter 1920 just prior to final formatting and output to theclient. Those of ordinary skill in the art will realize and understand,upon reading this description, that this type of processing (finalformatting, etc.) is performed by one or more handlers on the way “out”of the processing sequence.

The manifest channel 1906 is responsible for handling a single URL, andoptimizing the experience of the clients currently requesting theresource associated with that URL. The global strategizer 1908 isresponsible for optimizing the overall cache behavior, and the behaviorof the CDN as a whole. The global strategizer 1908 comprises a set ofpermanently running background tasks and services that monitor andmanage the cache, performing operations such as discarding old objects,prefetching latency-sensitive objects, and enforcing quotas. Like themanifest channel, global strategizer is preferably architected tocleanly separate policy and mechanisms, thereby allowing for futureenhancement and adjustment.

The global strategizer 1908 influences the manifest channel 1906 byadjusting a variety of modes and levels which the manifest channelsconsult when making their decisions. In turn, the global strategizermonitors the effects of the mode and level changes, and adjusts them asnecessary to achieve the desired global conditions. Thus, the globalstrategizer is the module in charge of the various feedback loops in thecache. For instance, by adjusting the maximum allowed object age, it cancontrol the amount of data in the cache, and by adjusting the maximumsize of objects allowed in the memory store, it can influence the amountof memory in use. In some implementations there may be no globalstrategizer and the storage system will manage its own resources, etc.

Implementations and embodiments of various components are described ingreater detail below. Those skilled in the art will realize andunderstand, upon reading this description, that the details providedbelow are exemplary and are not intended to limit the scope of theinvention.

The Manifest Channel 1906

The manifest channel 1906 handles issues related to a single resource.Its job is to deliver an optimal response to each client based onvarious factors such as, e.g., request details, policy settings, cachecontents, state of devices, peer caches, origin server, network, etc.The manifest channel 1906 consists of an extensible collection ofefficient mechanisms, e.g., for retrieval from disk; connectionmigration; filling from origin; checking peers, etc. A control moduleorchestrates the mechanisms, using canned algorithms for commonsituations and providing hooks for introducing variations to thesecanned algorithms. The manifest channel 1906 may be completelyscriptable, if necessary. The manifest channel 1906 may provide cleanseparation of mechanism and policy and may be more general than apipeline. In a present implementation, the manifest channel 1906 issequence (a pipeline of sorts), although each of the steps of thesequence may be arbitrarily intelligent (including being a script). In apresent implementation, the manifest channel is part of the storagelibrary and is used by a “cache handler” which is present in the processsequence. In this particular implementation the manifest channel itselfis not implemented as a sequence.

At any moment, there is one instance of the manifest channel 1906running for each manifest being actively accessed. The role of themanifest channel is to coordinate all activities associated with themanifest, ensure that each client requesting the object is sent anindividualized response meeting the policy constraints, and that this isdone as efficiently as possible and without violating other constraintsimposed by the global strategizer. Essentially the role of the manifestchannel is to deal with the caching of resources, construction of fillrequests, coordination of client requests with available responses, etc.The manifest channel preferably implements RFC2616-compliant cachinglogic. (RFC2616 refers to Network Working Group, Request for Comments2616, Hypertext Transfer Protocol—HTTP/1.1, the entire contents of whichare fully incorporated herein by reference for all purposes).

Other Handlers

Various handlers (e.g., in a customer-specific sequence) may includemechanisms with associated logic to perform some or all of the following(this is essentially a potential list of “handlers.”). These handlersmay or may not include a “cache handler” which uses the manifestchannel.

Mechanism Functionality Authentication Performs authenticationhandshakes with the client and queries internal databases or externalservers as necessary for permission to serve the resource to the client.These are typically synchronous operations. Internal databases arecached web objects, and may also need to be refreshed periodically.Referrer Handles cases where the reply depends on the HTTP referrerChecking header. General functions in the rulebase and rewriter willclassify the referrer, and this module implements the consequences ofthat classification (this is essentially an example of authentication)Browser Handles cases where the reply depends on the HTTP IdentificationUser-Agent header and potentially on other headers. Hot Store Allowobjects to be identified as high-popularity and worth keeping in faststorage such as application memory, the OS page cache or solid-statedisks, and for communicating that fact to the storage manager. ColdStore Allow objects to be identified as low-popularity and suitable forarchiving to more extensive but higher latency un-indexed mass storage.Peering Checking for information about which peers are likely to have anobject, and for directly querying peers via the peering service.Migration Deciding when to migrate a connection to a neighboring cache,and for marshaling the state to be transferred. Connection Handlingnon-cacheable traffic such as certain PUT requests, Splicing bydelegating further interaction with the client to the operating system,so that it can efficiently relay raw data between the client and theremote server. Also monitor the progress of such relays for logging anddiagnostic purposes. Longtail Dealing with resources making up workingsets that exceed the size of the cache. The module includes counters fordetermining the popularity of such resources, and support for specialtypes of filling and redirection that allow the CDN to handle themefficiently. Fill Target Support for filling resources in a flexibleway, e.g., from load Selection balanced clusters, from variouslocations, or with a variety of protocols. Range Dealing with rangerequests, for deciding whether it is worth fetching the entire object,and for formatting HTTP Partial Content (206) replies. Partial ObjectAssembling separately-fetched parts of the same object into a Handlingcomplete object, either logically or physically. Error MessageFormatting of informative and appropriate HTTP error Constructionmessages for the client when the request fails in some way. RedirectionEfficiently redirecting clients to other locations. Command Acting uponrequests to the command, monitoring and logging Handling subsystems, andfor constructing a variety of internally generated responses. VaryContent negotiation is defined in Network Working Group, Request forComments 2616, Hypertext Transfer Protocol—HTTP/1.1 (hereinafter“RFC2616”), the entire contents of which are fully incorporated hereinby reference for all purposes. The Vary field value indicates the set ofrequest-header fields that fully determines, while the response isfresh, whether a cache is permitted to use the response to reply to asubsequent request without revalidation. For uncacheable or staleresponses, the Vary field value advises the user agent about thecriteria that were used to select the representation. A Vary field valueof “*” implies that a cache cannot determine from the request headers ofa subsequent request whether this response is the appropriaterepresentation. RFC2616 section 13.6 describes the use of the Varyheader field by caches. According to RFC2616, an HTTP/1.1 server shouldinclude a Vary header field with any cacheable response that is subjectto server-driven negotiation. Doing so allows a cache to properlyinterpret future requests on that resource and informs the user agentabout the presence of negotiation on that resource. According toRFC2616, a server may include a Vary header field with a non-cacheableresponse that is subject to server-driven negotiation, since this mightprovide the user agent with useful information about the dimensions overwhich the response varies at the time of the response. According toRFC2616, a Vary field value consisting of a list of field-names signalsthat the representation selected for the response may be based, at leastin part, on a selection algorithm which considers only the listedrequest-header field values in selecting the most appropriaterepresentation. According to RFC2616, a cache may assume that the sameselection will be made for future requests with the same values for thelisted field names, for the duration of time for which the response isfresh. The field-names given are not limited to the set of standardrequest-header fields defined by the RFC2616 specification. Field namesare case-insensitive and, according to RFC2616, a Vary field value of“*” signals that unspecified parameters not limited to therequest-headers (e.g., the network address of the client), play a rolein the selection of the response representation. According to RFC2616,the “*” value must not be generated by a proxy server; it may only begenerated by an origin server. In some cases it may be desirable to havea communication channel between the CDN and the origin server, in orderto ingest policy information about variant selection performed at theorigin so that the same can be directly replicated within the CDN ratherthan being inferred from a series of responses from the origin. ContentContent negotiation as defined in RFC2616. Encoding TransformsTransforming (distinct from content negotiation), includes, e.g., videotransmux, rewrapping, image conversion/compression etc. LoggingControlling the amount and type of logging information generated by therequest processing, and for saving that information in internallygenerated objects for later retrieval by special HTTP requests and/orperforming remote logging. Tracing Enabling diagnostic tracing of theprocessing, either globally or for a specifiable subset of requests orresources. Billing Collecting a variety of billing-related informationwhile the request is being processed. Throttling Allow certain types ofactions to be delayed based on advice from the global strategizer.Keepalive Checking various factors that influence the decision to allowconnections to persist, and methods for conveying or delegating thefinal decision to the connection manager. Transfer Deciding whattransfer encoding to apply, and for applying it. Encoding ShapingDeciding on what bandwidth to allocate to a network activity, and forconveying this information to the connection managers. Prefetch Allows arequest for one resource to trigger prefetching of other resources, fromdisk, peers or the origin. Refresh Implementation of the HTTP “GETIf-Modified-Since” etc., and “304 Not Modified” mechanism, as well asthe background refresh feature. Retry and Allow failed fills to beretried from the same or a different fill Failover target. CacheabilityDecides if, where and for how long an object should be cached by theStorage Service. Script execution Execute requests and replies that areCDN internal scripts. Replacement Decide which objects in the manifestare no longer sufficiently useful and can be destroyed.

Global Strategizer 1908

The global strategizer 1908 is the subsystem responsible for overseeingthe operation of the cache as a whole, and the cache's relationship toother parts of the CDN. The global strategizer is preferably running atall times, and keeps track of extrinsic parameters such as the amount ofstorage used, the number of clients, etc. In turn, it controls operationof the cache by adjusting intrinsic parameters like the LRU (LeastRecently Used) Aggression and the listener poll and accept rates.

Invalidation.

The global strategizer is responsible for fetching, preferably roughlyonce per second, updates to the primary invalidation journal from theCDN control mechanism, fetching updates to any secondary journals thatthe primary indicates have changed, and invalidating the resources thatthe secondary journals indicate have been invalidated. It should beappreciated that the control mechanism for customer invalidations maynot be the same control mechanism as used for configuration data (andinvalidations associated with it). Different groups of customers may beput onto different such control mechanisms for invalidation.Invalidation is discussed in greater detail separately.

Automatic Refresh.

This mechanism allows selected resources to be refreshed even when theyare not being requested externally, so that they are always up to date.The invalidation journal mechanism is essentially a special case ofthis.

Load Metrics.

The global strategizer is in charge of measuring the total load on themachine, and responding to requests for load status.

Platform Configuration and Control.

Mechanism to act upon configuration information from the controlmechanism.

Listener and IO Event Rate Control.

Controls the rate at which new connections are accepted, and the rate atwhich file descriptors are polled for readiness.

As with the other components/mechanisms described herein, the functionsdescribed here are not necessarily performed by a single entity ormechanism but by multiple tasks or sequences. However, those of ordinaryskill in the art will realize and understand, upon reading thisdescription, that the set of tasks which perform these functions couldbe considered as making up the “global strategizer.”

Control Mechanism Data

As noted above, the control mechanism 108 maintains the authoritativedatabase of the current CDN configuration and of information needed tooperate the CDN. The database includes various interconnected tablesthat are used to describe and/or manage the CDN. With reference to FIGS.20-21, the database includes system configuration objects 2002, customerconfiguration objects 2004, a customer invalidation journal 2006, and amaster journal 2008. Those of ordinary skill in the art will realize andunderstand, upon reading this description, that different and/or otherobjects may be maintained in the database.

In a presently preferred implementation, the control mechanism 108maintains and stores some or all of the following information (as partof the system configuration objects 2002 or customer configurationobjects 2004), some of which may be used for rendezvous, and some ofwhich is used by cache machines.

Global Configuration Object (GCO) (2112)

The GCO is described in connection with request response processing.

Customer Configuration Scripts (CCSs)

Customer Configuration Scripts are described in connection with requestresponse processing.

HostTable (2102)

The HostTable 2102 is a list of all machines in the network. This listis maintained in a table (HostTable) that includes, for each machine,its network address (IP address), and preferably its bandwidth capacity.

The HostTable preferably stores a Bandwidth Capacity value (BWcap). ABWCap value is also stored in the ClusterTable, described below. Anactual value for Bandwidth Capacity value is derived from these twovalues according to the following table in which clusterBW representsthe bandwidth capacity value set on the cluster, hostBW represents thebandwidth capacity value set on the cache and nhosts represents thenumber of machines in the cluster:

clusterBW HostBW BandwidthCapacity 0 0 0 >0 0 clusterBW/nhosts 0 >0hostBW >0 >0 min(clusterBW/nhosts, hostBW)

While it should be sufficient to use just one of these tables to setBandwidthCapacity, as described here, this is not always the correctapproach. Specifically, the calculated BandwidthCapacity variable ispreferably not used by the server selector (SS) mechanism (of therendezvous mechanism), rather the server selector directly uses thevalue from the ClusterTable for shedding based on cluster-totalbandwidth, and the value from the HostTable for shedding based onper-host bandwidth. The BandwidthCapacity is set in both tables, sincethe HostTable entry tracks the uplink from host to switch whilst theBandwidthCapacity at the cluster is the uplink from switch into thenetwork fabric.

The reason that the server selector does not use the calculated per-hostBandwidthCapacity is that it is generally wrong for purposes ofcontrolling shedding to avoid saturating a per-host uplink. That is, ifBandwidthCapacity is set only in the ClusterTable, then the systemcalculates a per-host value as clusterBW/nhosts (see above table). Bute.g., if there are twenty machines sharing a 10G uplink, that value is0.5G, which is too small: each machine is preferably, but notnecessarily, able to individually burst to 1G (or higher, depending onthe connection from each server to the switch) before causing shedding(assuming the overall cluster uplink is not saturated, i.e., not allmachines using 1G at the same time). Alternatively, e.g., if there arefive machines sharing a 10G uplink, the system would calculate 2G, whichwould be too large if the individual machines only have a 1G link.

Therefore the BWcap values should generally be set both in the HostTableand ClusterTable.

As there is preferably an entry in the HostTable for every machine inthe network, non content-serving machines should have their BWCap valueset to zero.

In an embodiment, each type of machine at a location is preferablygrouped into one or more clusters, with a corresponding entry in theClusterTable (2104).

SMED Table (2108)

The SMED Table 2108 is a list of “measurement equivalent” caches in atable (SMEDTable). In practice, this list equates to a rack of hardware;i.e., the set of machines plugged into a single router. Each entryincludes one or more clusters.

Cluster Table (2104)

The Cluster Table 2104 describes each cluster. Recall that a cluster isnot the same as a site (all of the machines that are plugged into agiven switch), but the subset of those machines that share the same setof VIPs. As such, there may be multiple ClusterTable entries for a givensite. The Cluster Table stores information about the region(s) that eachcluster is in.

Each cluster contains a number of HostTable entries, one for eachphysical machine, and one or more VIPs (each of which is represented byan entry in the VIPTable).

In an embodiment, all machines on the network are preferably representedin this ClusterTable (and directly in the HostTable). To be able toidentify which are content serving machines, there is a flavor column inthe ClusterTable.

As with the HostTable, non content serving clusters should have BWCapset to zero. Having these machines represented in these tables allow forinfrastructure components such as the measurement components to make useof processes on non-content serving machines.

VIP Table 2106

A VIP is the locally load-balanced address, handed out as the target ofrendezvous. If this VIP is used for secure traffic, it contains areference to a node in the SSLTable.

As such, there is one entry for each VIP address in the network. Noncontent-serving clusters do not need to have VIPs defined.

SSL Table 2110

An entry in the SSLTable describes one “secure” property; it identifiesthe mapping between super-name and certificate.

Flavors Table

The Flavors Table 1912 describes characteristics that are shared by allmachines of a certain flavor (e.g., content serving). The term “flavor”is used here to distinguish between machines that perform differentfunctions within the CDN (e.g., content serving, etc.).

CoServers Table 2116

As used herein, a coserver, with respect to a particular resource, is anorigin server—the authoritative source of the particular resource. TheCoServers Table contains descriptions of all CoServers (origin servers)and Alias Nodes defined in the system. This table holds informationabout all customer origin servers registered with the CDN. This table isused to associate incoming requests to these entries, and describes how,and from where, the resource needed to satisfy that request is to beretrieved. Note that as CDN objects are also handled by the CDN, someCDN servers may function, at times, as coservers.

In some implementations, alias Nodes may be associated with a BaseCoServer, and provide a way to separately report and log trafficassociated with a particular alias attached to a CoServer withoutneeding to cache the same resource multiple times.

The CoServers table preferably includes the following fields:

Field Description IsActive Flag indicating whether or not the entry isconsidered to be active. SubID A numerical subscriber ID number; a keyinto the Subscriber Table (1918). CosID The unique ID number associatedwith this entry (this value is also a key into this table). Port Theport number over which the origin server associated with this entry ispreferably, but not necessarily, contacted for cache fill purposes. AltWebRoot The Alternate Web Root, the location within the content tree ofthe origin server where the ‘root’ associated with this property isconfigured to be. That is, when performing a cache fill the value ofthis is prepended to the incoming URI path on the request (see ExtendedAliases). Defaults to ‘/’ (although any trailing ‘/’ on this value isremoved during the conversion process, making the default effectively”).Hostname The name of the origin server associated with this entry. Canbe specified as either a FQDN or as an IP address. Protocol Whichprotocol to use when contacting the origin server associated with thisentry. In presently preferred implementation, options are ‘HTTP’,‘HTTPS’ and ‘FTP’. AliasList A list of aliases associated with thisentry. An incoming request is compared to the list of these aliases whendetermining which entry is associated with that request. As such, eachalias needs to be unique, and so these form an additional key.

Subscriber Table 2118

The Subscriber Table 2118 includes information about subscribers to theCDN (e.g., the CDN's customers).

As noted above, a control mechanism may maintain and store only some ofthe tables and other information listed above. In some implementationssome of the tables or information may be combined or omitted. Apresently preferred implementation includes a host configuration filefor each host (which defines listeners, etc.), a GCO, and a CCS for eachproperty.

Aliases

An Alias is a name by which a CoServer is known to the network, and isused to identify that CoServer during request processing. The term aliascan refer to both the format of this identifier, as well as certainattributes of the identifier. A list of ways that the term is usedfollows:

Term Meaning Simple Alias a FQDN (Fully Qualified Domain Name); thevalue of the Host: provided to the CDN by the client. e.g.,fp.example.com Extended an alias may include one or more top-leveldirectories, in which case a Alias match requires that both thepresented Host: header and initial path element match the alias. e.g.,fp.example.com/dir. This allows behavior to be specified for differenttop-level directories of URLs presented to the CDN; for instance, aparticular directory could be filled from a different origin server.Wildcard the initial element of the hostname portion of an alias can bea ‘*’ in which Alias case it will match any subdomains. e.g.,*.example.com will match fp.example.com and fp.subdir.example.com, aswell as the unadorned example.com. Note: that a Wildcard Alias may alsobe an Extended Alias; e.g., *.example.com/dir. The wildcard characterhas to be a complete hostname element; i.e., it is not possible to have*fp.example.com. Concrete aliases may exist alongside wildcard ones andpreferably take precedence over them. Request See description above.Processing The complete set of active aliases (i.e., those associatedwith active CoServers), be they Simple or Extended, are used to populatea lookup table (e.g., a hash table) within the agents of the network.This table provides a mapping from each alias to the CoServer IDassociated with that alias. When a request is received, the first pathelement of the request is joined to the value of the Host: header, and alookup into this hash table performed. If no match is found, secondlookup(s) is(are) performed of just the Host: If a match is then found,processing completes since the appropriate CoServer has then been found.The initial lookup is preferably done with the Host: header only, and ifan extended alias exists, a flag is set that indicates so and then asecond lookup performed. If no match is found, then a second hash tableis inspected, which contains down cased versions of the directoryelement of each extended alias (the Host: value always being processeddown case). If a match is then found, and this CoServer is flagged asusing case insensitive paths, then a match is declared, and processingcompletes. Preferred implementations should start with just thehostname; look for exact match and if none found then deal with wildcardmatch. Once a match is found, then start on paths to find the best matchIf however no match is yet found, a search for a possible Wildcard Aliasmatch then begins. The most significant two hostname elements (e.g.,example.com) are looked for in another hash table; if an entry thereexists, then the next hostname element is added and another checkperformed. This continues until an entry marked with an hasWildcard flagis set, indicating that a matching Wildcard Alias exists. If thematching entry is marked as having a directory extension, then a checkof the top-level path element from the URL is then made, similar to theprocessing for a normal Extended Alias. If no such match is found, thena match on the Wildcard Alias is only declared if a Simple WildcardAlias is defined.

Request-Response Processing

FIG. 19 showed the logical structure of a cache and its variouscomponents. The processing performed by some or all of these componentsmay be performed by sequencers. A sequencer uses a sequence controlobject which is made up of an ordered list of handlers. In a presentlypreferred implementation, a sequencer is an Executive task (preferably achannel), and the handlers associated with a sequencer (task) areimplemented by events. It is necessary for the task to be an Executivechannel so that it can use the submit (potentially asynchronous) model.

Request-Response Processing Flow

Request-response processing flow is described now with reference toFIGS. 22-A to 22-C. For the purposes of this description, assume thatthe processing is being handled by a cache server such as server 1102(FIG. 15) in a CDN.

The cache server obtains data (an incoming connection) at a port andparses sufficient incoming data (at 2202) to determine that the datacorrespond to an appropriate type of request (e.g., HTTP). The incomingdata will include sufficient information to allow the cache to determinewhether or not it can serve the requested resource. E.g., in the case ofan HTTP request, the incoming data will include HTTP header information,including (a version of) the URL that was used to make the request.

In order to determine whether or not it can serve the request, the cacheserver needs to compare information associated with the request withinformation in the global configuration object (GCO). The cache servertherefore needs to determine whether it has a valid GCO (at 2204). Ifnecessary, the GCO is retrieved by the cache from the control mechanism(at 2206). If the current GCO is valid then it can be used, otherwisethe GCO must be validated or a new one obtained. It should beappreciated that if the cache is unable to obtain a valid GCO after somepredetermined number of tries then it should not serve the requestedcontent and should fail (and take itself out of rotation for selectionuntil it is able to retrieve a valid GCO). It should also be noted thatthe GCO is likely considered a candidate for pre-fetch.

In a current implementation the GCO acts as a “white list” carryingvalid protocols, hostnames and path prefixes. In some cases, for certainreseller properties, customer identification can also be performed basedon the VIP on which the request came in. Such a technique may also beused to provide a simple transparent proxy implementation. The GCO mapsthe protocol, hostname and path prefix to a customer identifier(Customer ID). The following table shows an example GCO (the numbers inthe left column are provided for purposes of description, and are notintended to be limiting in any way.)

String Customer ID 1 http://customer1.com/ 1.1 2 http://customer2.com/2.1 3 http://*.customer3.com/ 3.1 4http://*.special.images.customer3.com/ 3.2 5http://*.images.customer3.com 3.3 6 http://images.customer3.com 3.4 7http://customer4.com/ 4.1 8 http://customer4.com/topd1/ 4.2 9http://customer4.com/topd1/subd/ 4.3 10 http://customer4.com/topd2/ 4.311 http://customer5.com/ 5.1 12 https://customer5.com/ 5.2 13*://customer6.com/ 6.1 14 http://customer7.com/ 7.1 15http://customer7.com:8080/ 7.2

The string in a GCO is some or all of a URL. Wildcards may be used, butare limited. Recall that (for the purposes of this description) a URLhas the form:

<<protocol>>://<<domain>>/<<path>>

where <<protocol>> may be, e.g., “http”, “https”, “ftp”, and so on;<<domain>> is a fully qualified domain name (FQDN) and path specifies alocation. A formal URL description is given in RFC 1738, UniformResource Locators (URL), by T. Berners-Lee et al., URIs are described inNetwork Working Group RFC 2396, “Uniform Resource Identifiers (URI):Generic Syntax,” by T. Berners-Lee et al., August, 1998, the entirecontents of each of which are fully incorporated herein for allpurposes.

The “protocol” may be replaced with a label for the listener on whichthe request came in. The reason is that a given customer may have adedicated SSL listener which presents their server certificate, so thecache will only want to satisfy requests for that particular customer onthat listener. In that case, the GCO may have, e.g., “https-CUST” (e.g.,if CUST is a customer with a customer SSL VIP) as the “protocol.”

In the GCO, the protocol may be replaced by an “*” (a wildcardcharacter), indicating all supported protocols map to the same CustomerID (see, e.g. no. 13 in the table above). A wildcard character (e.g.,“*”) may also be used as part of the first component of the hostname(e.g., nos. 3, 4, 5). Thus, “http://a1.customer3.com” and“http://a2.customer3.com” will both match entry number 3 in the tableabove. In order to simplify the rules for resolving ambiguities, in someimplementations wildcards may not be used anywhere else and may be theentire first component of the hostname.

Having completed the raw parse (at 2202), the cache knows the URL thatwas used to make the request.

Once the cache has a valid GCO it tries to find a match for the inputURL in the GCO (at 2208). Preferably a “Best match wins” strategy isused. The hostname is checked first, and an exact match wins, otherwise,a wildcard match is used with greatest number of literal matches wins.For example, for customer3.com: the string“special.images.customer3.com” maps to 3.2 (more literal matches than3.3); images.customer3.com maps to 3.4 (exact match). Next the port andprotocol are looked up, then, longest path prefix wins.

The flow chart in FIGS. 22-A to 22-C shows a potential loop from theGCO-Exception hook if no response is generated. To prevent a loop fromoccurring the system may only try the GCO lookup a limited number oftimes, e.g., up to two times. The point of the GCO-Exception hook is toallow inspection/correction of the request such that it can be found inthe GCO. However, the system preferably only gets one shot atcorrection.

Each customer may have corresponding scripts (sequences) that are to beused to process that customer's requests. These Customer ConfigurationScripts (CCSs) are associated with the customer ids, and, if the request(the URL) relates to a valid customer (at 2210) (based on the lookup inthe GCO), then processing continues to determine (at 2212) whether thereare CCS (Customer Configuration Scripts) corresponding to that customer.The CCS, if present, is checked for validity (at 2214) and a new CCS isfetched (from the control mechanism) if needed (at 2216). As notedpreviously, the CCS is used to assemble sequences, which are then cachedand used until they become invalid (due, e.g., to a new CCS beingretrieved). It should be appreciated that scripts and sequences are notthe same thing, although as mentioned previously, a particular handlermay invoke a script to perform its function.

In presently preferred implementation the CCS is a Lua script retrievedfrom the Control mechanism. The name of the script may be based on thecustomer's ID, e.g., for Customer ID 4.2 the script may be obtained at:https://core.fp.net/ccs/ccs-4.2.luac

The script sets up customer-specific subsequences at various hook pointsin the main processing sequence. Results of this setup are preferablycached, and the CCS is not run on every request. It is re-run if thescript is reloaded or if conditions change. For example, if results ofthe script are cached persistently, then agent revision could change.The compiled script is an object consumed by the caches, but the scriptitself is generated from customer configuration description in adatabase.

Once the CCS is configured (loaded and validated) (at 2218), processingcontinues (FIG. 22-B) with a hook (denoted “cli-req”—client request) tohandle any corresponding custom processing. That is, “cli-req” is a hookpoint where a subsequence of customer-specific handlers (which mayinclude a script) is inserted. As an example, suppose that a certaincustomer requires:

-   -   Set www.customer1.com as canonical hostname    -   Strip sessionid parameter from all query strings

These actions may be taken in cli-req (client request) hook, for whichexemplary CCS source would be:

-   -   hook[“cli-req”].add(“set-host(‘www.customer1.com’)”)    -   hook[“cli-req”].add(“strip-query(‘sessionid’)”)        where both set-host and strip-query are simple one-shot        handlers, inserted into a larger sequence.

As another example, suppose the customer has the same client-siderequirements as above, but also wants to set the fill target to beorigin.customer1.com

The corresponding CCS source would be:

-   -   hook[“cli-req”].add(“set-host(‘www.customer1.com’)”)    -   hook[“cli-req”].add(“strip-query(‘sessionid’)”)    -   hook[“fill-req”].add(“set-target(‘origin.customer1.com’)”)        where set-host, strip-query, and set-target are simple one-shot        handlers, inserted into a larger sequence.

This CCS adds an action to the fill-req (fill request) hook.

As another example of a configuration script, suppose that a customerrequires proxy authentication using auth.customer1.com for remoteauthentication. The customer's CCS would include:

-   -   hook[“cli-req”].add(“proxy-auth(‘auth.customer1.com’)”)

The proxy-auth handler launches a sequence of its own to perform theactual authentication request and waits for the response. This is anexample of a blocking handler which launches a helper request. Based onthe response to the authentication request, the proxy-auth handler maygenerate an HTTP 401 response immediately or allow processing tocontinue.

Another way to handle this with CCS (if a native proxy-auth handler isnot always available) may be:

if handlers[“proxy-auth”] == nil then  hook[“cli-req”].add( “lua-txn(‘proxy-auth.luac’, ‘auth.customer1.com’)”) else hook[“cli-req”].add(  “proxy-auth(‘auth.customer1.com’)”) End

Preferably, however, a missing handler is preferably, but notnecessarily, handled in a manner that does not require such aninteraction with the CCS builder. E.g., there is always a proxy-authhandler—if there is no native one, the processing of the CCS will causea library to be inspected/pulled which will provide a scripted versionof it. One benefit of this sort of approach is that the CCS is thenindependent of the version of software running on the edge, and hencecan be shared amongst peers of different generations. It should beunderstood and appreciated that the fact that the CCS is specified as ascript and can make decisions about the sequence to generate based oninspection of its local environment is sufficient to allow CCSs to beshared across the network.

This logic is part of CCS builder, not the configuration writer. Asingle network-wide CCS can make these decisions based on localenvironment. CCS can use arbitrarily complex logic to assemble thebuilding blocks for the customer, including making additional requests,etc. “Native” handlers could also be built-in scripts behind the scenes,but preferably native handlers are expected to be efficient C code. Itshould be appreciated that the CCS is a per-customer object. It shouldalso be appreciated that a human configuration writer does not need todeal with this detail; they just need to know that they wantauthentication. In addition, it should be appreciated that the CCSshould not be run on every request (unless it is invalidated).

Rather, the CCS is used to configure the agent to handle a givencustomer's requests by setting up the appropriate handlers at thevarious hook points. Those handlers themselves may invoke a script orscripts, but they do not have to and it is expected that a typicalcustomer's requests will be handled without using scripts (e.g., Lua) atall in the main request processing path. The fact that the CCS is ascript rather than a simple list of handlers to install at hook pointsmeans it can be flexible in inspecting its surroundings to determine theproper handlers for the environment (software revision, region, etc.) inwhich it is running

As can be seen from the flow diagram in FIGS. 22-A to 22-C, hooks areavailable at numerous points in the processing sequence. There may behooks available for, amongst other things, some or all of:

-   -   client requests    -   cache fills    -   GCO exceptions    -   cache misses    -   fill responses    -   fill pump    -   client responses    -   client pump

Those of ordinary skill in the art will realize and understand, uponreading this description, that different and/or additional hooks may beavailable and used in a particular implementation.

As noted earlier, default processing is available, and the cache willservice requests without any customer-specific sequences, provided thecustomer is valid (e.g., found in the GCO) and requires nocustomer-specific processing.

As the various elements of the CDN are themselves potential clients (andsources of resources), the CDN may provide a CCS for CDN resources. Froman implementation perspective, the CDN may be treated as a customer,with entries in the GCO and with its own CCS(s).

Load Balancing and Peering

The goal of local load balancing in a cluster (i.e., cluster-level loadbalancing) is to evenly distribute load across the nodes of the cluster,and to ensure that each connection gets handled by as few nodes aspossible, preferably by only one node, even in the presence of failures.In some systems, cluster local load balancing may be accomplished usingthe techniques described U.S. Pat. No. 8,015,298 titled “Load-BalancingCluster,” filed Feb. 23, 2009, issued Sep. 6, 2011; and U.S. PublishedPatent Application No. 2010-0332664 titled “Load-Balancing Cluster,”filed Sep. 13, 2010, the entire contents of each of which have beenfully incorporated herein by reference for all purposes.

An example of such a system is shown in FIG. 23-A, in which a requestassociated with a VIP is multicast via a switch (preferably a dumbswitch) to all live nodes in the cluster. The nodes use local firewallsto block/accept traffic. These systems may not, strictly speaking, beload balancers, since some load is transmitted to each node in thecluster for each packet received at the switch. These systems move someof the load spreading functionality into the firewall of each individualnode. Such techniques allow the use of a dumb switch instead of anexpensive load balancing appliance.

Higher Level Load Balancing

Some systems, e.g., as described in U.S. Pat. No. 8,015,298, provide forrequest-based migration of TCP connections. In a system described inU.S. Pat. No. 8,015,298, referred to herein as Approach A, migration isperformed on each request, and the connection may be moved back andforth between multiple machines in a cluster during its lifetime. When aserver accepts a connection it uses the HTTP request on that connectionto decide which machine (i.e., which cache in the cluster) should handlethe request. The server then migrates the connection, plugging andpoking firewall holes as needed to ensure the target of the migrationaccepts further traffic and the source drops it. The attributes of therequest used to make the migration decision are configurable (e.g., URL,Host header, other headers, etc.), as are the number of machines to beinvolved in the target selection process (via various parameters). Insome implementations, these are per-coserver configuration settings.

Peering

In some cases, e.g., in some of the systems just described, when a cachemiss occurs (e.g., at 2220 in FIG. 22-B), all peers in the cluster andneighboring clusters may be queried to determine if any peer has theresource cached. If one is found, the local cache may be filled fromthat peer. If none is found, the local cache may be filled from apre-configured parent.

The load balancing solutions described above work for IPv4 traffic, butIPv6 traffic may require a different approach due to the lack of ARP inIPv6. One solution to the lack of ARP in IPv6 is to apply the samestrategy as described above to the protocols that IPv6 provides. Forexample, the IPv6 Neighbor Discovery Protocol (NDP) may be used by eachnode in the cluster to detect the liveness of all other nodes in thecluster, and this information may be used to update the firewall. Astateful firewall and a simple switch handle the rest, as in the IPv4system.

High-Level Load Balancing and Peering

In addition to or instead of the above approaches, the CDN 100 mayprovide application-level load balancing which also addresses local andremote peering. TCP/IP connection transfer is an optional component ofthis approach that may be used within a cluster, but is not required(and may be unnecessary).

Resource Striping and Capacity Allocation

Within the context of a single cluster, some information about theproperty of each request (e.g., the request URL) is mapped, e.g., viahashing, to a unique slot s in a circular array of NS slots. At anygiven time, each node in the cluster is assigned responsibility for some(preferably contiguous) interval of slots. The slot ranges of thecluster nodes may be assigned arbitrarily as long as the number of nodesresponsible for a slot is always within some prescribed [min, max] rangeof nodes per slot (a node is said to be responsible for a slot s if itsinterval covers s, i.e., if s is in the range).

For example, suppose there are five (5) nodes in a cluster and 1,000slots (numbered 0 to 999). One possible slot configuration that isconsistent with [min, max]=[1,2] is the following:

[0,99],[50,149],[100,500],[200,800],[700,999]

For any given slot configuration, all requests will be served by nodesresponsible for the corresponding slot. Additional constraints on slotintervals, and on changes to slot intervals, may also be imposed inorder to avoid unnecessarily large shifts in responsibility, to enabledistributed computation of slot intervals, to increase fault tolerance,and to simplify the slot allocation algorithm.

Capacity allocation may be implemented by allocating a different [min,max] range to different intervals of the slot circle, and by hashingURLs for different properties to different intervals of the slot circle.The total capacity corresponding to a slot interval is the area of theslot interval divided by the total area of the entire slot range. Aproperty's capacity allocation is its relative capacity per slot (basedon the number of other properties mapped to the same slot) times theactual capacity of each slot to which it is allocated.

Slot-Based Load Balancing

Slot intervals determine which resources get handled by which nodes inthe cluster, and a hashing function determines which resources map towhich slots. It should be appreciated that although the hashingfunction(s) that control the distribution of resource names across slotscan be arbitrarily complex, the function(s) cannot guarantee that theactual load of requests over time has any particular distribution. Forexample, a given sequence of requests over some time interval mightresult in a relatively high load across small slot intervals on thecircle, depending on how the resources for those requests are named.

To account for this, the system preferably dynamically adjusts theposition and width of slot intervals such that areas of higher load havea higher density of nodes per slot. The capacity allocation providesconstraints on the solution to this adjustment, and the total number ofslots limits the resolution with which such changes can be made.Periodically (e.g., every minute), the slot interval for each node maybe reassigned based, e.g., on the following information:

-   -   node liveness;    -   load on each node;    -   the previous (or default) sector range values.

Nodes may have their slot interval expanded, contracted, or shifted by ahigh-level local load balancing algorithm, the result of which is tochange the density of nodes per slot to meet the capacity allocationconstraints and compensate as much as possible for actual loaddistribution within those constraints.

When a node fails, the density of nodes per slot in the node's area ofprevious responsibility will drop (potentially to zero, depending on theprevious slot configuration). Two strategies may be adopted to deal withthis:

-   -   When computing a new slot configuration, always allocate a        minimum density of two nodes per slot.    -   Run the load re-balancer whenever a node failure is detected.

With this approach, assuming no more than one failure per loadrebalancing interval, no slot should ever be left uncovered.

Client Request Handling

The basic approach, elaborated incrementally here, leads to three rolesfor nodes in a cluster which distinguish their varying degrees ofresponsibility with respect to caching and remote filling of particularresources (see FIG. 23-B). These roles need not be fixed per node, butmay depend on the request context.

For example, in some cases three degrees of node responsibility for anygiven resource may be used, based, e.g., on hashing. These differentdegrees of responsibility may be used to provide separate control overhow many nodes will cache a resource and how many will reach out to aremote node (e.g., a parent node) to fill a request. For example:

-   -   Non-responsible (will not cache but will proxy only to a        Super-Responsible peer)    -   Responsible (will cache, and will fill only from a        Super-Responsible peer)    -   Super-Responsible (will cache and will fill from a parent        (“remote peer”)) (Preferably there are no nodes which are only        fill responsible, as such a setup would perform rather poorly        because n/m requests would end up being proxied from the origin        server [n is number of fill-responsible-only nodes, m is cluster        size] without being cached.)

Those of ordinary skill in the art will realize and understand, uponreading this description, that a different number of roles for nodes ina cluster may be used for different degrees of responsibility, withdifferent cache and remote-fill approaches for each.

It should also be appreciated that a node's degree of responsibility forparticular resources may be determined on a continuous scale and neednot necessarily be discrete.

The slot allocation scheme determines which resources a given node isconsidered to be “responsible” for, and this responsibility implies amore aggressive approach to caching the resource than other“non-responsible” nodes.

In the first approach (see algorithm 1 below and FIG. 23-C), uponreceiving an (external) client request (for resource R), the nodedetermines if it is responsible for the resource. If the node determinesthat it is responsible for the resource, it consults its cache andresponds from there or it fills from a super-responsible peer. If it isnot responsible, it proxies from a super-responsible peer but does notupdate its local cache. The idea behind avoiding a local fill and justproxying in the case where the node is not responsible is that the nodewill never be asked by another local peer to provide that resource.Using this approach would let the responsible local peers handle thefill and storage, and avoid the storage and disk I/O costs associatedwith filling resources for which local peers will never ask.

Algorithm 1 Handle Request-1 (If Non-Responsible Then Proxy) functionHandleRequest( R )  R.slot ← slot ← SLOT(R)  nodes ←ResponsibleNodes(slot)  if self ε nodes then   if R ∉ localCache then   FillFromPeer(R, nodes − {self})   end if   return localCache(R)  else  return ProxyFromLocalPeer(R, nodes)  end if end function

This approach (Algorithm 1) may provide lower latency for the currentrequest than filling locally, but the problem is that subsequentexternal requests to this node for the same resource will always proxythrough other nodes. Alternatively (see algorithm 2 and FIG. 23-D), thesystem may adopt a more opportunistic approach and allow nodes to cacheresources they are not responsible for, provided they favor theresources they are responsible for in terms of their cache evictionpolicy.

Algorithm 2 Handle Request-2 (If Non-Responsible Then Fill) functionHandleRequest ( R )  if R ε localCache then   return localCache(R)  endif  R.slot ← slot ← SLOT(R)  nodes ← ResponsibleNodes (slot) FillFromPeer (R, nodes − {self})  return localCache(R) end function

Local Peer Proxy and Fill

To proxy from a local peer (see algorithm 3 and FIG. 23-E) the systemmay determine the set of responsible nodes and ask them if anyone hasthe resource cached. If one or more local peers have it, the systemarbitrarily chooses one and requests from there. Otherwise the systemchooses any responsible peer and requests from there. The idea is thatthe system requests through a responsible peer even if it knows it doesnot have it (rather than filling from a remote peer) because the localresponsible peer is likely to need it more than the current node. Thisreduces the possibility of remote fills for the same resource comingfrom different nodes on the same cluster, which makes better use ofbandwidth to remote peers.

Algorithm 3 Proxy From Local Peer (Query All Responsible) functionProxyFromLocalPeer( R, nodes)  holders = QueryLocalPeers(R, nodes)  ifholders ≠ Ω then   choose h ε holders  else   choose h ε nodes  end if return RequestFrom (R, h) end function

Note that ProxyFromLocalPeer is invoked in Algorithm 1 using a set ofresponsible nodes.

Filling (see algorithm 4 and FIG. 23-F) is similar to proxying in thequery-all-responsible approach, with the addition of updating the localcache.

Algorithm 4 Fill From Local Peer (Query All Responsible) procedure FillFrom Local Peer( R, nodes)  holders = Query Local Peers(R, nodes)  ifholders ≠ Ω then   choose h ε holders   localCache(R) ← requestfrom(R,h)  else   Fill From Remote Peer(R)  end if end procedure

Note that the same principle that non-responsible peers use to delegateto responsible peers can be used within the set of responsible peers fora resource in order to decide who should do a remote fill. The systemmay put a bound on the number of peers who will attempt a remote peerfill for a given resource, as it could be more efficient for the systemas a whole for a small number of local peers to fill a given resourcefrom a remote peer, and then have the local peers get it from eachother. This would require two kinds of “responsible” peers, plainresponsible peers, and “remote-fill-responsible” (super-responsible)peers (where the latter do remote fills, the former do not).

To achieve this, the system further partitions the set of responsiblenodes as follows. First sort the set of N responsible nodes by theirunique node IDs to produce an array, then split this array into K parts,and index each part with the hash of the resource key to determine up toK nodes that will be responsible to fill. Since all nodes are assumed tohave the same knowledge of what nodes are responsible for whatresources, this computation can also be done in distributed fashion(each node computes it independently and they all arrive at the sameresult).

With this the system can dispense with the querying part, and with theassumption that K will usually be very small (say 1 or 2), the systemjust randomly chooses one of the fillers and expects it to either havethe resource or fill it remotely. This achieves load balancing of theremote fill workload within the set of responsible peers for any givenresource and bounds the number of remote requests from a given clusterfor the same resource. Assuming Filler-Peers determines the K nodesresponsible for remote fills as just described, this leads to theno-query version of the fill from local peer algorithm (see algorithm5).

Algorithm 5 Fill From Local Peer (No Query) procedure FillFromLocalPeer(R, nodes)  fillers = FillerPeers(R, nodes)  choose f ε fillers localCache(R) ← RequestFrom(R, f ) end procedure

A similar no-query version of the fill from local peer algorithm may beused for the proxying case, and the system could also apply the queryapproach within the now even smaller set of filler peers. But at thispoint the system has reduced the set of nodes to consider so far already(from the whole cluster, to the responsible nodes within the cluster, tothe responsible fillers within the responsible nodes), that it isprobably not worth it, especially if doing so requires implementation ofa completely different request/response protocol than just simplepeer-to-peer HTTP requests.

Remote Peer Fill

Once a node has decided to fill from a remote peer it simply determinesthe name of a remote peer and fills from it (see algorithm 6). The term“remote peer” is used here instead of parent in order to emphasize theremoteness and to de-emphasize any presumed parent-child relationships.In this approach there is no single hierarchy in the CDN, and even asingle node in a cluster may refer to multiple remote peers, dependingon the context of the request and the state of the network. The onlyguarantee expected is that a remote peer must always be one step closerto the origin than the local requestor or the remote “peer” may even bean origin server. This results in a dynamic overlay lattice instead of astatic tree structure.

Algorithm 6 Fill From Remote Peer procedure FillFromRemotePeer( R,nodes)  server ← RemotePeerName(R, R.peerLevel + 1)  localCache(R) ←RequestFrom (R, server) end procedure

Remote peer name selection may be based, at least in part, on some localconfiguration data that is retrieved as resources from the controlmechanism which can be invalidated and refreshed, and partly on therendezvous system. For each property served by a cluster node, a methodof choosing a remote peer name for a resource is specified, and thismethod is used to compute the name of the server to contact. TheRemotePeerName procedure (see algorithm 7) uses the configured method toreturn the server name to the request-handling algorithm when needed.

This provides a simple means of load balancing of requests acrossmultiple remote peers for given collections of requests. Different nameselection methods enable different strategies for doing so, and alsoallow different divisions of responsibility between control mechanismconfiguration, cache nodes, and the rendezvous system, without makingany significant changes to the cache implementation beyond configurablename selection.

It is assumed that the cache's consumption of control resources couldresult in the definition of named configuration variables. These namedvariables might define numeric constants, single names, ordered lists ofnames, or lists of lists, and they exist to provide input data tovarious remote peer name selection methods. The choice of remote peername selection method is assumed to be an indication of one of severalpredefined methods that the cache provides, and RemotePeerName is just awrapper that invokes the appropriate virtual function. One other aspectis the remote peer level, which is assumed to be zero (0) for requestsreceived from clients, and is incremented at each hop to a remote peervia a suitable request header. If the level exceeds a threshold (whichcould be property specific), the name of an origin server is returnedinstead of a remote CDN peer.

Algorithm 7 Remote Peer Name Selection function RemotePeerName ( R,level )  if level >maxpeerlevel (R.propertyID) then   return Origin Name(R)  else   M ← rpnsmethod(R.propertyID)   return M(R, level)  end ifend function

Example methods that could be used for computing remote peer namesinclude:

(1) Return a constant remote peer name for all requests, provided in theconfiguration under variable rpname:

RPN←rpname

(2) Get a list of remote peer names (rpnlistbyagent), and index it bythe hash of the local node's agent ID (or perhaps the cluster ID):

rpnlist←rpnlistbyagent

RPN←rpnlist[hash(agentID)mod rpnlist.size]

(3) Generate a name based on properties of the request (e.g., certainbits of the sector, property ID, resource hash, etc.) and let therendezvous system do the load balancing work.

(4) Get a list of peer names by sector from the configuration (viavariable rpnlistbysector), and index it by the hash of the property ID:

-   -   rpnlist←rpnlistbysector(R.sector mod rpnlistbysector.size)

RPN←rpnlist[hash(R.propertyID)mod rpnlist.size]

While different algorithms/approaches have been described here for loadbalancing and peering, and for what to do when a cache miss occurs, itshould be appreciated that these approaches may be used alone or invarious combinations within a CDN. Furthermore, the approach(es) adoptedmay be configured within the CDN based on various factors. For example,the approach(es) to load balancing and peering may be property specific(e.g., they may be specified as part of a CCS). It should also beappreciated that the approach(es) may be modified (e.g., by modifying aCCS for a property) during operation of the CDN.

Probabilistic Customizations

At several points in the above algorithms decisions are made on where orhow to get something:

-   -   Does a non-responsible node proxy or fill when it retrieves from        a peer?    -   When it fills, does a non-responsible node fill from a remote        peer or a local peer?    -   When it fills from a local peer, is it any local responsible        peer, or a local fill-responsible peer?    -   When a responsible node fills, does it fill from a remote peer        or from a local fill-responsible peer?

Rather than hardwire specific choices for these into the algorithms,these decisions may be made according to specified probabilities thatmay be used to weight decisions (see FIG. 23-G and the flowchart inFIGS. 23-H to 23-I showing caching and peer filling choices). Exemplarysuch probabilities may include:

-   -   1. P(NRCACHE)—the probability that a non-responsible node will        cache instead of just proxy.    -   2. P(NRFILLREMOTE)—the probability that a non-responsible node        will fill from a remote peer, given that it fills from        somewhere.    -   3. P(ANYRESP)—the probability that a non-responsible node will        fill from any responsible local peer (as opposed to a        fill-responsible peer), given that it is going to fill locally.    -   4. P(RFILLREMOTE)—the probability that a responsible node (but        not a fill-responsible node) will fill from a remote peer, given        that it fills.

These probabilities may have preferred defaults of zero that may bechanged on a per property basis.

Extending Local Peering Across Clusters

The notion of peers is not limited by network organization or location.Thus, e.g., nodes closer to the origin have been referred to herein asremote peers even though they are not necessarily on the same cluster.We may also refer to local peers that are not on the same cluster. Anarbitrarily large cluster of clusters may be treated as a single logicalcluster as long as the nodes can address each other as independent nodesand can run a failure detection and slot allocation algorithm across theentire node collection. The fact that different subgroups are behinddifferent switches does not make any difference.

As the collection gets arbitrarily large, however, it may becomeimpractical to do the failure detection and slot allocation algorithmsin a flat way across the entire node set, so there is probably a maximumpractical size to a logical cluster (say 2 to 3 physical clusters)unless a more scalable technique is applied. The essential differencebetween local and remote peering is that when one local peer delegatesto another, it does so with the knowledge of exactly what node it isdelegating to, and what responsibility that node has with respect to thecaching and remote-filling of the resource. In other words, the twonodes share knowledge about slot responsibility. The key then, would beto convert the flat slot allocation into a more hierarchicallystructured one. One approach would be as follows:

Each physical cluster is assigned a unique subinterval of slots.

Each physical cluster locally determines its set of live nodes, and aleader communicates this set (and the load and slot assignments of eachlive node) to leaders in the other clusters.

Given such a partitioning, most of the work to determine failuredetection and slot assignments occurs locally within a cluster, and theonly price paid is an extra level of coordination at the logical clusterlevel, and some loss in flexibility in allocating capacity across theslot circle, since each cluster is responsible for a fixed subintervalof the circle.

The latter problem can be fixed as follows: instead of pre-allocatingnon-overlapping subintervals to each cluster and then trivially mergingthe result of running N instances of the algorithm, run the algorithmrecursively and produce the physical cluster interval assignments as anoutput of the algorithm instead of just as an input. To do this, run thealgorithm as if each cluster were a single node, but with a capacityweight equal to the number of live nodes in the cluster, which could begreater than one in the general case. The algorithm takes the cluster'scurrent interval as an input and potentially adjusts the cluster'scoverage as an output, and cluster intervals are allowed to overlap inthis case. Then, after the initial version of slot coverage at thecluster level is done, take the actual interval assignment for thecluster and use it as the starting point for running the algorithm againlocally on each cluster to determine actual node-level intervals, thistime treating each node within the cluster as an individual with aweight equal to one. Although a weight of one is used in this example,it should be understood that a system may have different weights pernode, depending on capability. In preferred implementations, all nodesin a cluster have equivalent capability.

It will be appreciated that this approach applies not just to one levelof physical-to-logical clustering, but to an arbitrary number of levelsof clustering. Those of ordinary skill in the art will realize andunderstand however, upon reading this description, that at some pointthe benefit of logical clustering reaches a maximum with respect toremote peering, and remote peering is preferably used instead.

Dynamic Gradual Topology Transitions

As described, for responsibility-based peering, resources hash to slotsthat are sprinkled with node references, each slot has a nearest nodereference that indicates a key node. From the key node, a set ofcache-responsible (CR) nodes is determined, based, e.g., on a configuredvalue for N_(CR) and the nodes in the vicinity of the key node.

In preferred embodiments, the initially-contacted node delegates toresponsible nodes without probing—it just determines the responsiblenode(s) and picks one. Delegation may involve, e.g., proxying,redirecting, connection transfer, etc., depending on the capabilities ofthe underlying cluster and what clients can tolerate.

Consistent hashing causes the effect of changes in capacity (nodes addedand/or dropped) to be proportional to the amount of the capacity change,i.e., the resources a node was responsible for before it dropped will beassigned approximately equally to all other up nodes.

Matching Capacity Density with Load Density

The standard consistent hashing approach does not, however, balanceload, it just handles capacity changes in a balanced way. The usualapproach is to pseudo-randomly generate multiple node references onto aslot circle (resources hash to slots, next node reference determines thenode to handle the resource). This approach does a good job of handlingthe redistribution of load evenly among other nodes when a node drops,but it does not balance the load if the load is not already evenlydistributed over the slot circle. The narrower the population ofresources involved, the less balanced it will be. Furthermore, even ifresource hash keys were distributed in a balanced way, resource requestrates are not.

Load feedback is used as a basis for repositioning node references(preserving their relative order) in a way that balances loaddynamically.

There are four methods for matching capacity density with load density:

-   -   1. Pseudo-random placement.    -   2. Uniform placement    -   3. Load density-driven placement    -   4. Load density-driven placement with 2nd-level hash for outlier        buckets.

A given unit of capacity may be a member of multiple, higher levelcapacity groups. In the case of nodes and clusters, a node's membershipin a cluster may be defined by a value in the range [0, 1]. It should beappreciated that a particular implementation may impose a finiteresolution on the fuzziness. More specifically, nodes (e.g., machines)may be members of multiple subclusters, subclusters may be members ofmultiple superclusters, etc. Various constraints may apply in specificcases in order to arrive at unambiguous bindings.

Peering Topology, Capacity Allocation, and Capacity Availability

As used herein, a peering topology defines a structure, specifying thegroups of which a component is a member. Also defines the total numberof capacity units that are allocatable to each group. The term “capacityallocation” refers to a current allocation of capacity units to eachgroup, within topology constraints. The term “capacity availability”refers to the actual current quantity of capacity that is available toeach group, within the allocation constraints.

Peering Topology Changes

For a given fixed peering topology (fixed in the sense of the set ofnodes that are in the domain and the maximum number of references thatare in the codomain of the fuzzy membership function is fixed),consistent hashing and the load and capacity balancing techniques aboveare consistent in that the amount of change they cause is proportionalto the amount of capacity (or load) that was added or removed.

Changing the maximum number of references for a node, removing a nodefrom the cluster's membership domain, adding a new node to the cluster'smembership domain, changing the number of slots, or changing the hashingstrategy are topology changes that require special handling to achieveconsistency, if consistency is even possible at all. It should beappreciated that consistency may not be feasible for changes to thenumber of slots or the hashing strategy.

Consistent Peering Topology Changes

Each peering topology is defined by a slot size and hashing strategy(e.g., a hash function). A peering topology preferably also includes anappend-only configuration of node (or subcluster) membership entries. Anexample peering topology is shown here:

  slots 6151 hash whoopdeedoo +node1 50 # gives node1 50 refs +node2 50+node3 70 ... −node1 # deletes node1 entirely −node2 20 # deletes 20refs of node2 +node883 50

The generation of node references on a slot circle proceeds bygenerating (adding or removing) the references corresponding to eachentry, in order.

The system provides a gradual, dynamic transition from a consistentlyhashed peering topology immediately following a capacity loss (or gain)to a load balanced topology that may not necessarily be consistent withrespect to the topology prior to the change. This process tracks thenon-uniform load of individual slots, and spreads the capacity ofavailable machines over the load of some number of slots. It should beappreciated that the system may do this for a case where a slot set isactually a multidimensional metric space, and nodes occupy a subset ofthis space). It should further be appreciated that while this approachis used in responsibility based peering, it is not limited to thosesystems.

Load feedback may be used as a basis for repositioning node references(preferably preserving their relative order) to balance loaddynamically.

Invalidation

This section further discusses the mechanisms of invalidation internalto a CDN service (e.g., a cache node). From the point of view of the CDNservice, it is assumed that the control mechanism publishes (i.e., makesavailable) information about what resources should be invalidated, andthe CDN service obtains (e.g., pulls) this information at an appropriatetime. These mechanisms are described elsewhere herein. What is describedhere is what can be specified in an invalidation command and how thiscommand may be executed by the CDN service (whether via the backdoorpull of invalidation commands from the control mechanism, or via afront-door management command directly to the CDN service). It should beappreciated that the front-door mechanism (as the term is being usedhere) is strictly for local control, and it would not be used in normaloperation. It might be used, e.g., by an operator trying to get aresource out of a particular cache (e.g., for troubleshooting).

A simplified model of what invalidation attempts to achieve is used herefor the purposes of this description. The goal of invalidating aresource is to prevent that resource from being used withoutrevalidation. Practically, invalidating a resource marks it such thatthe resource in CDN service at the time of invalidation (if any) willnot be used without revalidation. Other variations on this theme made inactual practice are important but do not fundamentally affect the degreeof difficulty of finding and marking the right resources, and they areignored.

Invalidating individual resources for which the URL is specified in theinvalidation command is simple. For example, hash the URL, look it up inan index, find the object, and mark it (essentially the same as thelookup process when serving the resource). The URL does not have to bestored in the index (typically a hash table or tree of some sort) forthis to work.

Invalidating groups named by a pattern is much harder. The pattern inthis case could be as simple as a URL prefix that all implied URLs areexpected to have, a case-independent version of the matching URLs, or ascomplex as an arbitrary regular expression. In all of these cases thereis no single URL known in advance that the cache can use to lookanything up (and the number of possible matches could be unbounded),instead the cache needs to iterate over the entries in the index andfind the ones that match the pattern. Achieving this requires that theURL be known for each entry visited in the iteration. This feature maybe referred to as “expression-based invalidation.”

A naive extension of the hash table approach might be to store URLs inthe table entries, but this is expensive in terms of space and veryinefficient in time, since the system would have to traverse the entireindex and test the invalidation patterns on each URL to find which onesto invalidate. Using a sorted map data structure (like a binary tree)does not help either for URL patterns in general. Furthermore, even ifthe matching objects could be found efficiently, it could take a reallylong time to mark all the metadata corresponding to each one if they areon disk and not in memory.

If invalidations are launched from one of a handful of portals and thenbroadcast to the entire CDN, this can result in a large volume ofinvalidations flooding the network at any given time, which in turncould lead to the performance of unnecessary work at each cache node.The control mechanism solves part of this problem by arranging forinvalidations to travel only to the CDN service nodes that care aboutthem (e.g., with sector resolution). Therefore, it can be assumed thatthe invalidations received at a CDN service (e.g., cache) are morelikely to apply to the resources currently cached at that node. Beyondthat, the system needs three things to deal with the efficiencychallenges local to the CDN service (cache):

-   -   (1) an efficient way to find all nodes corresponding to a URL        pattern,    -   (2) an efficient way to mark all nodes corresponding to a URL        pattern, and    -   (3) some general limits (on the number of nodes that can be        invalidated at once) to ensure bad things never happen, since        URL patterns can refer to an unbounded number of resources.

A modification of a trie data structure concept is used to provide anefficient way to look up URLs.

As is well known, a trie, or prefix tree, is an ordered tree datastructure used to store an associative array where the keys are usuallystrings. In a trie, no node in the tree stores the key associated withthat node; instead, a node's position in the tree defines the key withwhich it is associated. All descendants of a node have a common prefixof the string associated with that node, and the root is associated withthe empty string. Values are normally not associated with every node,only with leaves and some inner nodes that correspond to keys ofinterest. A trie provides a way to lookup a key in time proportional tothe length of the key. In other words, using a trie allows finding thevalue corresponding to a key in about the same time it would take justto compute a hash. A trie is just a tree where each key string in thetrie corresponds to a path in the trie, and the branching at each levelin the tree may be based, at least in part, on the alphabet over whichthe keys are defined. Whole keys are not actually stored directly in thetree, but they are implied for each node by the path to the node. Thiscompresses the storage space required for keys when URLs have commonprefixes, as is typical.

The challenge with the traditional approach to tries is still spaceefficiency for the structure of the tree besides the implied keyinformation. Typically each node carries the information for onecharacter and represents a string corresponding to the characters on thepath from the root to the node. Each node has no more than one directdescendant for each unique character in the alphabet of the keyspace.This “child-map” could use an array covering the entire alphabet, andthe system could index this array to find the link to the descendant foreach character, but this would have a huge cost in space (which would beexponential in the depth of the tree).

A number of techniques may be applied to optimize the space used by thetrie while retaining the same time complexity:

-   -   (1) Use the fact that URLs consist of about 85 legal characters,        and never use a child-map longer than this (this requires        mapping the actual URL characters statically to the range 0 to        84).    -   (2) Position the URLs in the static index map, so that        characters most frequently used have smaller indices, and allow        the size of the child map to be based on the actual range of        indexes used by a node's immediate children. This further        reduces the expected average size of the child maps in a trie.    -   (3) Allow the child map to be a simple list of a small maximum        size (to be searched instead of indexed), and convert to an        indexed array only if the number of children exceeds the size        threshold.    -   (4) Allow nodes to jump multiple characters. If all the children        of a node have a common prefix relative the node's current path        in the tree, then the single character of the node can be expand        to a string of arbitrarily length. This reduces the number of        nodes it takes to advance a certain distance in a URL.

In a prototype implementation in which all of these techniques were usedexcept for the frequency based approach, a population of about 57,000unique URLs taken from actual CDN logs from three binding groups wereinserted into a trie. The actual number of characters consumed by theURLs was about 7.3M, or about 127 characters per URL. After insertioninto the trie the space of the trie nodes and associated strings wasabout 7.4 MB, whereas the size it would have taken to just store all thekeys as MD5 hashes in a hash table would have been about 2.3 MB. If theMD5 hashes were replaced with the actual URLs for keys instead, it wouldhave taken 8.8 MB.

Though the trie's space utilization can probably still be improvedsomewhat, and though the actual space utilization is also highlydependent on the actual URLs, it may be reasonable to expect that thespace utilization of the trie described here is better than the naivehash-table approach, though still about three times more expensive inspace than the MD5 hash approach, although at least as fast. The spacegap would be narrowed if using SHA-256 (which would have consumed 3.2MB) or SHA-512 (5.1 MB) instead of MD5. What has been achieved issomething that provides structural information that can be used to moreefficiently search the space of URLs for patterns.

This approach generalizes to patterns.

Realizing that each pattern corresponds to a finite state machine whichrecognizes matching strings, the task of finding all strings that matcha given pattern is reduced to a trie-traversal, where all subnodes of agiven node where there is a transition in the state machine from thecurrent state to some other state based on the character correspondingto the subnode. In the general case (which will be restricted later),there needs to be a check of all paths from each node where there is atransition. This relies on the fact that the state in the finite statemachine is uniquely determined at each node in the trie, and it allowsan incremental evaluation of the state transitions instead of having torun the state machine from the start state≧N times to find N matches.This is an optimal search, since for a given pattern and correspondingstate machine, the approach executes the least possible number of statetransitions needed to evaluate all URLs in the tree or rule them out.Entire subsections of the tree are ruled out as non-matches at the firstfailing transition.

This approach extends to the parallel matching of multiple patterns.Given a set of K patterns in their initial state, a traversal of thetree as described above can be performed, maintaining one state for eachof the K patterns. The traversal to a subnode continues if any of thestate machines accepts the transition (and for those machines that donot, they are ignored from that point on in that sub-tree). The searchalong a particular path stops when there is no machine that can make atransition, and the sub-tree of that path is ruled out. Someimplementations may choose to perform some or all of the searches inparallel.

A solution to the second challenge builds on the solution to the first.It would be desirable to just mark the trie in a small number of placesto indicate that all nodes below the marked points are invalidated. Forarbitrary regular expressions, there is in general no single node belowwhich all nodes are matches and all matching nodes are contained beneaththat node. Therefore, in the general case there is a need to find acollection of nodes that cover all matching nodes and only matchingnodes. The size of this collection may be close to the size of thematching set, so in the general case there may not be much gain byfinding it.

Patterns that end with a wildcard, however, will tend to produce asmaller cover, and if the pattern is a constant string terminated by awildcard, then the pattern corresponds to a unique node in the trie,below which all nodes are matches. This is ideal.

In general, whenever it is known that all nodes below a given node arematches for the invalidation pattern, the traversal can stop and markthe node in a way that says “everything in the sub-tree rooted here isinvalidated at time T.” Then, whenever a resource is looked up in theindex, it is possible to keep track of the invalidation markers as thetree is traversed, computing the most recent invalidation time along thepath to the node. This invalidation time is compared to the actualtimestamp on the resource, and if it is older, it is considered invalid.If it is newer, that means it was refreshed or revalidated sometimeafter the most recent invalidation marker applying to it was set in thetree.

Note that as resources are filled and revalidated, their timestamps arerecorded but the system does not need to attempt to clean up the tree'sinvalidation markers. The actual invalidation state of the resource iscomputed when it is accessed. This assumes that all access paths to theresource will go through the trie, and there will be no attempts to usethe resource without also consulting the trie.

Assuming that not all properties will need the capability to do patternoriented invalidation, and since hashes are useful for many things, theapproach above may be best applied as an option for certain properties,implemented via an auxiliary URL index in addition to the MD5-based hashtable. For properties with the feature enabled, all requests forresources in that property will go through the auxiliary index, and allinvalidations will walk the tree, as described. For other properties,all invalidations will be matched per URL, by computing the hash andlooking it up in the MD5 hash table.

The types of expression patterns should preferably be furtherconstrained to be those that result in some maximum number of trie nodesas the cover for the matching set. The actual number of URLs in thematching set does not matter. This requires a fixed prefix in theinvalidation; in order to support suffix invalidations (e.g., “*.jpg”)additional such indexes would be needed.

Machine and CDN Configuration

Recall that a service (e.g., a caching service, a reducer service, acollector service, a rendezvous service, a control service, etc.) may beconsidered to be a mechanism (e.g., software and/or hardware, alone orin combination) that runs on a machine, where a “machine” refers to anygeneral purpose or special purpose computer device including one or moreprocessors, memory, etc. Recall too that a particular machine may runmultiple CDN services, i.e., services on behalf of a CDN. As discussedabove, the various CDN services that a particular machine is running onbehalf of the CDN, or the various roles that a machine may take on forthe CDN, may be referred to as the flavor of that machine. A machine mayhave multiple flavors and a machine may change flavors.

This section describes how machines and services are provisioned andconfigured.

In all of the flows described here it is assumed that events are beinggenerated and reported (as event streams) from the machine.

Starting a Service(s)

It is first useful to describe the process of starting a service (anarbitrary service) on a machine. In order to start running a service (S)on a machine, with reference to the flow chart in FIG. 24-A, firstobtain the application (code) corresponding to service S, i.e., toprovision the service S (at 2402). Recall that the code (software)corresponding to a service may be referred to as the application forthat service and that the application for a service may be treated as aCDN property or resource. Thus this check for application code maycorrespond to determining whether or not there are resources on themachine corresponding to the required code for the service S. Since theapplication code for service S comprises one or more resources (CDNproperties), the application code may be invalidated in the same manneras other resources. With reference to FIG. 24-B, to obtain theapplication (code) corresponding to service S (at 2402), first check todetermine if the code is already on the machine (at 2404). If there isno code (determined at 2404), or if the current version of the code isnot valid (determined at 2406), then the machine obtains the latestversion of the application for the service S (at 2408).

With reference to FIG. 24-C, the machine may obtain the latest versionof the application (at 2408) by obtaining it from the control mechanismand/or from a peer (at 2410). Since an application may comprise morethan one resource, it may not be necessary to obtain all of theresources comprising the application. That is, it is only necessary toobtain the invalid or missing resources.

With the latest version of the application (either already present orobtained at 2402), the machine then obtains configuration informationfor the service (at 2412). That is, with the application for the serviceprovisioned, the machine then configures the service. With reference tothe flow chart in FIG. 24-D, in order to obtain configurationinformation for the service (at 2412), the machine determines whether italready has configuration information for service S (at 2414), and, ifso, whether or not that configuration information is valid (at 2416). Ifthe computer does not have current /valid configuration information (asdetermined at 2414, 2416), then it obtains the latest version of theconfiguration information for the service S (at 2418). The machine mayobtain the configuration (at 2418) by obtaining it from the controlmechanism (at 2420, FIG. 24-E).

Those of ordinary skill in the art will realize and understand, uponreading this description, that the flow charts in FIGS. 24-B and 24-Dhave the same structure. As with the application (code) for a service,the configuration information for a service is preferably made up of oneor more resources (CDN properties) on the machine. Therefore the sameapproach may be used by the machine to obtain the configurationinformation. It should be appreciated that although two flow charts areused here to describe the process, the same underlying mechanisms may beused to obtain current versions of these resources (whether they beapplication code or configuration information).

With reference again to the flowchart in FIG. 24-A, having obtained theapplication for service (S) (at 2402) and the required configurationinformation for service S (at 2412), the system then needs to determinewhether a version of this service is already running on the machine (at2422). As noted earlier, a machine may run multiple services, and someof these services may be of the same type. For example, a machine mayrun multiple reducer services, alone or along with other kinds ofservices. Preferably there is only one Autognome (S0) service permachine.

If it is determined (at 2422) that a version of this service (S) isalready running on the machine then the system determines (at 2424)whether the new version of the service is to replace the old version orwhether they are to both run on the machine. If the new version is toreplace the old version (as determined at 2424), then the system haltsthe old version (at 2426) and then starts the service (S) (at 2428).

If it is determined (at 2422) that this service (S) is not alreadyrunning on the machine, or if there is an old version and it is not tobe replaced (as determined at 2424) then the system starts the service(at 2428).

Halting a Service

With reference to the flowchart in FIG. 24-F, when a running service isto be halted (e.g., “Halt Running Service” at 2426 in FIG. 24-A), thenthe system should determine (at 2430) whether the service should stopimmediately (a hard stop) or whether it can wind down. If the serviceshould make a hard (immediate) stop (as determined at 2430), then theservice is terminated (at 2432). On the other hand, if the serviceshould first wind down (as determined at 2430), then the service windsdown its activities (at 2434) before terminating (at 2432).

Winding down a service (at 2434) is service dependent and may includeone or more of the following:

-   -   1. Stop accepting requests (at 2436)    -   2. Flush the system (at 2438)    -   3. Finish current processing (at 2440)

It should be appreciated that the various wind-down activities may beperformed in any appropriate order, including in series or in parallel.No order is implied for these three activities in the diagram in FIG.24-F. Flushing the system may also (or instead) take place after theservice is terminated (at 2432).

As an example, a cache service may wind down by taking no more requests;and completing servicing of its current requests. As another example, areducer service may wind down by no longer accepting incoming eventstreams and finalizing its processing on the event streams that italready had. A rendezvous mechanism may wind down by no longer acceptingincoming rendezvous request (e.g., name resolution requests) and byfinalizing and processing its outstanding requests. A collectormechanism may wind down by no longer accepting inputs and by completingprocessing on the data it already has. Normal winding down activity maybe curtailed to allow for halt processing in cases that prefer to avoidan immediate halt but require an expedited halt.

Those of ordinary skill in the art will realize and understand, uponreading this description, that different and/or other wind-downprocessing may occur.

Startup Service(s) [2428]

Some services may depend on one or more other services and may requirethe one or more other services to be running before they can begin. Eachservice may start its dependent services (at 2441 in FIG. 24-G) as partof its startup process.

In order to start its dependent services (at 2441), with reference toFIG. 24-H, the system first determines the list of dependent services(at 2450) and then starts each of them (at 2452) using the same “startservice” process described with reference to FIGS. 24-A to 24-I. Itshould be appreciated that dependent services may, themselves, havedependent services.

Prior to starting, a service may need to be configured and conditioned(at 2443). Some configuration may need to take place before the serviceis started. For example, typically each service is configured to producecertain log information.

The configuration and conditioning of a service (at 2443) may alsoinclude certain administrative tasks. Preferably each service registerswith control mechanism (at 2454, FIG. 24-I). A service may also register(at 2456) with various other services (e.g., with reducers and/orcollectors to which it has been configured to send event streams). Theservice preferably also starts event logging and streaming (at 2458).

A service may start immediately or it may warm up before starting.Accordingly, with reference to FIG. 24-G, when a system starts a service(e.g., at 2428 in FIG. 24-A), the system first determines (at 2442)whether the service is to start immediately or whether it should firstwarm up. If the service should start immediately (as determined at2442), then system starts running the service (at 2444). On the otherhand, if the system should first warm up (as determined at 2442), thenthe system performs a warm startup (at 2446).

For a warm startup the system performs one or more warm up strategies(2448-1 . . . 2448-k). As with winding down, warming up is servicedependent, and there are various warm-up strategies that can be adoptedfor each kind of service. As shown in FIG. 24-G, the various warm upstrategies (2448-1 . . . 2448-k) may be performed in any order(s),including fully or partially in parallel. No order is implied by orshould be read into the order in which the activities are presented inthe drawing.

Autognome

For any machine on (or to be added to) the CDN, the setup of Layer 0,should minimally ensure that Autognome (S0) is installed and will be runas a service, along with a minimal configuration file that defines theagent ID, a list of initial control mechanism names to contact forfurther instructions, and possibly some keys and certificates.Preferably no other setup is required.

Autognome may be started as with any other service. Thus, with referenceto FIG. 24-J, Autognome may be started (at 2450) using the start serviceprocessing described with reference to FIGS. 24-A to 24-I. PreferablyAutognome (S0) is started with an immediate start.

When such a minimal system is (re)started, Autognome will read theminimal configuration file and also detect where it last left off onthis machine, e.g., by looking for some persistent state (which will bereapplied if necessary). Using knowledge of its identity, Autognome (S0)will then contact the control mechanism (using information in theinitial minimal configuration file) for its network configuration andits agent configuration (at 2460, FIG. 24-K). The network configurationmay define, e.g., the actual control node(s), NDR node(s), andapplication code repositories it should communicate with. The agentconfiguration defines the desired state of services to be run on thelocal machine. After retrieving the agent configuration, Autognome (S0)establishes the desired service state, loading RPMs as needed from itsassigned repositories and logging its state changes via events to theNDR nodes (and to its local persistent store) (at 2462).

From that point on Autognome (S0) listens for additional commands (e.g.,over HTTP) and polls the control mechanism for updates to its agent andnetwork configuration every so often (say every 10 minutes) (at 2464),and retrieves/reapplies such configurations when necessary (at 2466,2468). It should be appreciated that process of starting changed/newservices (2468 FIG. 24-K) may use the start service process (2400 ofFIG. 24-A), and may include shutting down unneeded services.

In preferred implementations Autognome (S0) will be idle most of thetime.

Preferably steps in configuration state changes at a local agent thatare applied by Autognome (S0) are logged as events to the appropriateNDR agent(s). These event streams may be reduced in the usual fashion toget global, real-time feedback on the changes taking place in thenetwork. Individual Autognome services can also be queried directly forstatus information via HTTP requests.

When Autognome starts multiple services (e.g., at 2462 and possibly at2468 in FIG. 24-K), those services may be started in any order (unlessthe system imposes some ordering). Thus, multiple services may bestarted in series, in parallel, or in some combination thereof

Autognome can be used for monitored and controlled deployment of newversions of CDN software. This deployment, under control of the controlmechanism, need not be applied to all machines. For example, suppose aCDN operator wants to deploy a new version of CDN software (e.g.,caching software) to some subset of clusters that meet certain criteria,and that this new version is backward compatible (i.e., the service canbe restarted and the cache will still be valid). The CDN operator alsowants to do this gradually and with minimal disruption, view the statusof the change as it happens, and be able to back it out if somethinggoes wrong.

The control mechanism knows the version(s) of CDN software that eachmachine should run. This version information may be defined, e.g., inthe agent configuration. Changes in a machine's agent configuration filemay cause changes in the software running on that machine.

The control mechanism can apply arbitrary rules to pick some of themachines to be updated. For example, the control mechanism may deploy anew version of CDN caching software on all clusters with cluster IDsdivisible by 4 in a particular data center. A rule in the data centerlevel agent configuration template may be modified to use the newversion of the CDN software when clusterID mod 4=0. A new version of theagent configuration file would then be detected at the next controlpulse, and the change would be initiated.

When a machine (via Autognome's consumption of the new agentconfiguration) learns that it needs to run a different version of CDNsoftware it issues a stop command to the services that need to bestopped (at least the service being updated, possibly others), itinstalls the proper version of the RPMs needed, and then restarts therequired services. The machine (perhaps via Autognome) then runs a localhealth check to determine whether or not the change was successful. Ifunsuccessful, the change is undone. If the undo fails, the machine willattempt a recovery (as defined by the agent's configuration, and mayinvolve a restart of the machine). Such reconfiguration would generallybe performed by machines coordinating the activity amongst themselves.For instance, when a cluster is notified that it is preferably, but notnecessarily, upgraded to a new version of software, this will typicallybe performed as a rolling upgrade across the machines in the cluster; afirst machine is selected and the upgrade applied to and the second onlybegins to perform its upgrade once the first has been verified assuccessfully upgraded. This reduces impact to the network as a whole byminimizing the number of machines that are winding down at any giventime.

At each step of the way, events are generated to enable remotemonitoring of the actual status of the machine during the deployment.Such events can also be used to influence the rendezvous system. Forinstance, when performing an upgrade of cache service software on acluster of machines, new client requests may be directed to alternatelocations until that process has completed (either bringing up the newversion of the cache service software on the cluster being upgraded, orafter having been successfully rolled back if a problem is encountered).Alarms can be set up based on collection of these events in NDR todetect systems that are stuck in failed attempts at reconfiguration(e.g., it tried a restart but never came back). Such systems may requiremanual intervention.

Using Autognome for Automatic Binding Reconfiguration

Bindings establish the mapping between groups of properties and a set ofmachines provisioned to serve those properties in a particular way.Changing bindings involves (1) recognizing that the current bindings areover or under provisioned, (2) deciding what a better binding would be,and (3) making the necessary changes. This all needs to be done in aglobally stable manner (in the control systems theoretic sense ofstability). Collaboration between the NDR and the control mechanismprovide the means to implement (1) and (2), and Autognome provides themechanism for (3).

For (3) to be possible even with Autognome, there is preferably either apool of available machines that can be rebound on demand, or bindingchanges need to be zero sum (capacity removed from one binding groupmust be allocated to another one). If the pool of available capacity ismodeled as a binding group of its own (or perhaps several), then allchanges can be considered as being zero sum. These binding pools may bedefined by geography and/or by the kind of hardware their machines havein common. Other active binding groups may then be defined to be linkedwith one or more of these virtual binding pools. The pools are then thesource when additional capacity is needed in a binding group, and theyare the destination of capacity when a binding group has overcapacity.

To bring new systems into a binding group and to take systems out, itmay be preferable for additional service specific commands to ramp aservice up (e.g., warm/prefetch an edge cache) or ramp a service down(e.g., drain an edge cache). These operations must be accounted for inthe command set that Autognome can issue to specific services.

Adding a Component or Service to the CDN

Adding a Machine to the CDN

When a new CDN machine is added to a CDN, the CDN (the controlmechanism) determines what role(s) that machine should take within theCDN (i.e., the control mechanism determines what flavor the machineshould have). This role/flavor determination may be based, at least inpart, on information provided by the machine to the control mechanism.The new machine will then provision and configure the appropriateservices for its role(s). Different services will have differentconfiguration requirements and options.

Those of ordinary skill in the art will realize and understand, uponreading this description, that a new machine may be one that has neverbeen connected to the CDN before or one that has been disconnected fromthe CDN for some reason.

Addition of a new machine to a CDN is described here in greater detail.For the sake of this description, and with reference again to FIG. 2-A,a “new” CDN machine is a machine 300 configured with at least sufficientcore program(s) 302 and at least one provisioning service S0(“Autognome”) to enable initial provisioning of the machine within theCDN. As part of its configuration, the machine 300 is preferablyconfigured with a hostname of the CDN's control mechanism (e.g.control.fp.net), and upon being connected to a network (e.g., theInternet), the machine contacts the control mechanism and performs someinitial registration. This process may allow the control mechanism todetermine whether the machine is authorized to participate in and be apart of the CDN. The registration process is preferably automated andperformed by programs or services (e.g., Service S0) running on themachine and on the control mechanism.

In presently preferred implementation, a new machine may be added to aCDN by starting the Autognome service (S0) on the machine as describedabove (FIG. 24-J).

The machine may include information (e.g., certificates) to enable thecontrol mechanism to perform authentication as part of the initialregistration.

Prior to provisioning and configuration of other services, the initialservice (Service S0) preferably confirms that it is up to date. If not,S0 updates itself and the machine starts running the updated version ofS0 (terminating the prior version). It may be necessary for the machineto reboot itself one or more times in order to be running the mostcurrent version of S0. In general, service S0 (“Autognome”) alwayschecks that it is running the latest version of itself before proceedingwith any provisioning or configuration.

Once a current version of Autognome (S0) is running it contacts thecontrol mechanism to obtain configuration information. The machine (viaAutognome (S0)) preferably also provides the control mechanism withinformation about the machine itself (e.g., its capabilities, hardware,etc.). This information may have been provided as part of theregistration process.

Although the machine was preconfigured with a hostname of the CDN'scontrol mechanism (e.g. control.fp.net), the control mechanism mayprovide the machine with a different address to use once registrationhas taken place.

The control mechanism determines what role(s) the machine should takewithin the CDN. This determination may be based, at least in part, onone or more of the following factors:

-   -   (1) information provided by the machine (e.g., capabilities,        hardware, etc.),    -   (2) a network location of the machine (as determined by the        control mechanism),    -   (3) current needs of the CDN,    -   (4) load on components of the CDN;    -   (5) health of components of the CDN.

Those of ordinary skill in the art will realize and understand, uponreading this description, that different and/or other factors may beused to determine the flavor of a machine. In addition, it should beunderstood that operator intervention may be used to override controlmechanism decisions about a machines role(s).

Some of the information used to determine a machine's role(s) (e.g.,load and health information) may have been determined by the controlmechanism using the reducer/collector networks.

Once Autognome (S0) knows the role(s) that the machine is to play, itmay provision and initiate the services corresponding to each of thoseroles. For example, if the machine is to be a cache server (i.e., runcaching services), then Autognome (S0) provisions and initiates theappropriate caching services. Similarly, if the machine is to be areducer (i.e., run reducer services), then Autognome (S0) provisions andinitiates the appropriate reducer services, and so on for collectorservices, rendezvous services, etc. These services correspond toservices 308 (S1 . . . Sk) running on the machine 300. Recall that amachine may run multiple services of different kinds, so that, e.g., amachine may run cache server services and reducer services and collectorservices.

The machine may be shipped with software code for each of the servicesthat a CDN machine is likely to run, or Autognome (S0) may download thecode, as needed (e.g., using Repoman, described above). If the code fora service is already available on the machine, then its validity willneed to be checked. The machine may treat software code for the variousservices as CDN resources, and then use the CDN's invalidation processto determine whether or not to update the code for any particularservice.

Thus, for each role that the machine will take (as instructed by thecontrol mechanism), Autognome (S0): obtains/updates the code for theservice(s) associated with that role; and then configures and initiatesthe service(s) associated with that role.

As discussed above, each service may also produce certain loginformation. As part of its initial configuration, each service's logevents are configured. Since log events are preferably sent to one ormore reducers, the addresses of those reducers need to be provided tothe services. Each service should preferably register with the reducersto which it is to send event streams, so that the reducers know toexpect the streams and the services can ensure that at least one reduceris getting their streams.

Once a service is initialized it may begin its operation within the CDN.In some cases, as discussed below, delayed or modified startup may beused in order to “warm up” the service.

Adding a New Cache Service to the CDN

When a new cache service is to be added to the CDN (i.e., a new cacheservice is to be started on a machine in the CDN), the control mechanismneeds to get information about that new cache (e.g., what group/regionit is in, its IP address, its VIP, some capacity information, etc.).Similarly, in order to operate within the CDN, the new cache machineneeds to get the current customer configuration data and otherconfiguration data from the control mechanism.

Preferably a new cache service is started using the process for startinga service described with reference to FIGS. 24-A to 24-I.

A cache service may be pre-configured so that when it connects to thenetwork (e.g., to the Internet) it sends a request to the controlmechanism for the resources that it needs. These requests can be made ofthe control mechanism using standard HTTP requests. The new cacheservice may, e.g., request a single configuration object from thecontrol mechanism, and that configuration object may, itself, includethe URLs of other configuration objects needed by the cache service. Thecontrol mechanism may be configured to similarly request configurationdata from the new cache service, also in the form of one or more HTTPrequests, although preferably the new cache provides needed informationto the control mechanism as part of one of its requests. It should beunderstood that appropriate security and encryption may be used toprevent unauthorized connection to a CDN. Once the new cache hassufficient customer data (global data 1108 in FIG. 15), it can begin tofunction as a CDN cache service.

In some cases the new cache service may go through a warming phase(corresponding to “Warm Startup” 2446 in FIG. 24-G) in which it mayquery its neighbors or peers and preemptively pull the GCO (GlobalConfiguration Object) and some CCS data (e.g., of popular customers atthe neighbor) before accepting any incoming client connections(corresponding to a warm-up strategy 2448 in FIG. 24-G). The cacheservice may, in some cases, pre-fetch popular content (corresponding toanother warm-up strategy 2448 in FIG. 24-G). In some cases the new cacheservice may also influence local load balancing, so that for a period oftime it may get less traffic than other members of the cluster (e.g.,until its cache miss rate is substantially the same as the rest of thecluster of which it is a member) (corresponding to another warm-upstrategy 2448 in FIG. 24-G).

The addition of a cache service to a CDN is summarized here: a cacheservice newly added to the CDN preferably first registers with thecontrol mechanism.

Once registered, the cache service obtains configuration data from thecontrol mechanism. The cache may request the configuration data usingone or more HTTP requests. In some cases, e.g., as noted above, the newcache service may request a single configuration object from the controlmechanism, and that configuration object may, itself, include the URLsof other configuration objects needed by the cache.

In some cases, when a cache service is added to a CDN, the cache servicemay provide information to the CDN (i.e., to the control mechanism)about the cache's capabilities and/or capacities.

The CDN (via the control mechanism) may allocate the cache a specificrole (or roles) within the CDN. Such role allocation may be based, e.g.,at least in part on information provided to the CDN from the cacheserver. For example, the CDN may assign a newly added cache server therole of serving certain classes of resources /properties (e.g., by size,by type, by owner). The CDN may assign a newly added cache service a setof peers. This peer assignment may be based, e.g., on locationinformation (e.g., an IP address) associated with the new cache server.The CDN may allocate a cache service to a group or sector. Existingmembers of the cache service group or sector may need to be notified ofthe addition, in order to accept peering requests from the new server.

A cache server may also determine its peers by determining its location(e.g., behind a switch in a cache cluster).

It should be appreciated that the registration may be combined with theprocess of obtaining the configuration data.

Some of the configuration data obtained during this process maycorrespond to some or all of the global data 1108, and preferablyinclude the GCO. Since the CDN components essentially serve content toeach other (e.g., the control mechanism serves CDN configuration contentto the new cache (and vice versa)), from the point of view of the CDNcomponents, as noted, the CDN may sometimes be considered a customer. Assuch, the CDN may itself have one or more CCSs associated therewith.Preferably the configuration data obtained from the control mechanism bythe cache service includes one or more CCSs associated with the CDN.These CDN CCSs will allow the cache to perform the appropriateprocessing when serving CDN content to other CDN components.

The control mechanism may obtain data from the new cache. While thecache may provide some information to the control mechanism during theinitial registration process, the control mechanism may also obtainadditional information from the new cache after registration. Thisinformation may include information, e.g., relating to the capacity andtype of the new cache.

The new cache will also preferably verify that it is up to date as faras system/application software. This may require a bootstrap process topull new software packages, e.g., in the form of RPMs fromcaches/control mechanism, verifying them, installing them and restarting(up to and including rebooting the server to pick up new operatingsystem components for instance).

At this time the new cache is ready to begin serving content on behalfof the CDN. However, it may be desirable in some cases for the new cacheto “warm up” by obtaining information from other caches. In particular,the new cache may obtain customer data (e.g., CCSs) from nearby or peercaches in anticipation of serving content on behalf of those customers.Preferably the new cache will query members of the cluster it is in toobtain the popular CCSs and popular content that those cluster membersknow of. A cache may consider other caches to be nearby based on variousfactors, e.g., some measure of network distance, whether the othercaches are part of the same cache cluster or cache site, etc.

It should be appreciated that since the cache is using a hostname toconnect to the control mechanism, the CDN rendezvous mechanism canrendezvous the cache to a control mechanism machine or component that is“best” or “optimal” for that cache. In some cases, once the cache hasdiscovered (or been told) which other caches are members of its clusterand its peers, it may issue requests destined for the control mechanismto them as well, or instead. This may reduce direct load on the controlmechanism and accelerate retrieval of such data.

New Cache Warm Up

(Corresponding to “Warm Startup” 2446 in FIG. 24-G)

When a new cache service is added to a CDN, it may begin processing CDNrequests as soon as it has been recognized by the CDN (i.e., as soon asit has registered with the CDN), and obtained sufficient informationabout the CDN. The minimal amount of sufficient information that a newcache needs before it can begin handling requests includes some globalinformation. This minimal information will allow the cache to at leastknow where to go to get additional information needed to handlerequests.

In preferred cases, a new cache service should obtain at least a copy ofthe GCO before starting to accept and handle resource requests. Once acache has the GCO, it can at least determine whether requests are forproperties (i.e., for resources associated with CDN customers). Toactually serve a request on behalf of a particular CDN customer, thecache also needs a certain amount of customer-specific data, including,specifically, the CCS(s) for that customer.

There are various degrees to which a newly added cache can warm upbefore handling resource requests. At one extreme, the newly added cachecan go online (i.e., begin handling requests) as soon as it has theminimum information needed (e.g., the GCO). In those cases, the cachewill pull required CCSs as needed, effectively on demand. In such cases,the initial request response time for that cache will be relatively slow(since it has to essentially configure itself for each customer).

The newly added cache service may also look to its peers or to othercaches in the same cluster or cache site to determine additionalconfiguration information that it might beneficially have. For example,as noted above, the cache may obtain and process CCSs from peers orother nearby caches on the assumption that it will be serving content onbehalf of the same customers as those other peers and caches. In thesecases, since the new cache has already pre-processed CCSs from variouscustomers, once it goes online it will not have any delays relating tothose customers.

At another level, as discussed above, the cache may also look at theactual content (properties) that its peers and/or other nearby cachesare serving, and may choose to pre-populate its cache storage with thatcontent. In some cases, the new cache may pre-populate its cache storagewith known popular content that is being served by its peers and/orother caches.

In addition to (or instead of the above), a new cache may also warm up(i.e., preload certain information and/or content) based on informationor instructions received from the control mechanism during registration.For example, the control mechanism may advise a new cache that it mightbe serving a certain type of content on behalf of certain contentproviders. In these cases, the new cache can preload the CCSs andpossibly some of the content for those content providers.

Since the new cache may serve content to other CDN components (e.g., topeers), the CDN may preload the CDN's CCS(s) as part of a warm-upprocess.

Adding a New Reducer Service to the CDN

In addition to registering with the CDN, a reducer service preferablyknows where to send its event streams (its own log streams), where tosend the output of its processing (i.e., which collectors), and whichservices are sending it event streams. In an embodiment, a reducer alsoknows what filter function(s) to apply to its inputs.

Adding a New Collector Service to the CDN

In addition to registering with the CDN, a collector service preferablyknows where to send its event streams (its own log streams), where tosend the output of its processing (e.g., to the control), and whichreducer services are sending it event streams. In an embodiment, acollector also knows what function(s) to apply to its inputs.

Adding a New Rendezvous Service to the CDN

In addition to registering with the CDN, a collector service preferablyknows where to send its event streams (its own log streams). Arendezvous service also needs to obtain the latest version of therendezvous information (e.g., the mapping of supernames (CNAMES) toBNAMES, BNAMES to VIPs) as well as where to retrieve load andconnectivity data from (e.g., rendezvous collectors).

Example

Exemplary initialization of a new machine joining an existing CDN may beaccomplished through the following steps (with reference to theflowchart in FIG. 24-L):

-   -   1. (Platform Installation 2470) An authorized user gets access        to the machine and installs the minimal configuration (e.g., a        Linux distribution, kernel, and Autognome setup), establishes        the globally unique physical identity of the machine, and        configures the IP addresses of the machine's management NICs.    -   2. (Machine Registration 2472) The authorized user runs an        Autognome command on the machine to register it with some        control network (specified by the user). The user is        authenticated, and then the machine's physical identity is        registered, an agent ID is assigned, and a client certificate        for the agent is distributed to the machine from the control        network. The control network to contact for further instructions        may also be changed at this step.    -   3. (Agent Configuration 2474) Once registered, the machine is        initially in a “drone” state, a lone member of the CDN just        running the OS and Autognome. Autognome begins making regular        contact with the control network, authenticating itself each        time with its assigned client certificate, pulling the        configuration of the agent and changing its state accordingly.        This configuration specifies, e.g.:    -   the control nodes to contact for future instructions;        -   the event reducers to which to send agent configuration            state change events;        -   a manifest of control resources with version information.            This manifest lists separately retrievable control resources            that specify:        -   the service versions to run and what state they should be            in;        -   the cluster to join and the VIPs and ports to configure;        -   the client certificate to use for future control contacts.    -   4. (Service Installation 2476) Queries a remote RPM repository        for the RPMs needed to run the assigned service versions, and        installs them.    -   5. (Heartbeat/VIP Initialization 2478) The Heartbeat (HB)        service is started, which reads the cluster and VIP        configuration information from a set of local files generated by        Autognome, configures NICs and host firewalls (e.g., iptables)        for the assigned VIPs and port numbers, and begins monitoring        the status of VIP/ports on all machines in the cluster,        continuously updating NICs and/or the firewall as VIP        availability changes or configuration changes are received via        changes detected in the local files.    -   6. (Service Initialization 2480) Starts all other assigned        services, providing configured service identifiers and launching        each service into a particular target state.    -   7. (Service Configuration 2482) Each service may initiate        further contact with the control network for service specific        bindings and other configuration information (such as service        specific reducers to use). Services which accept requests will        begin listening on VIPs, which the HB ring will detect and        respond to with corresponding firewall changes.    -   8. (Steady State) Eventually all machines in the cluster will        converge to a consistent view of VIPs that are up, with all        configured services in the desired state and listening to the        right VIPs.

Machine Reconfiguration

Once configured the first time, a machine's Autognome may periodicallypoll one of its assigned control nodes for configuration changes.Changes could include one or more of:

-   -   Assignment to different control nodes or reducers;    -   Allocation of a different client certificate;    -   Assignment to a different cluster;    -   Allocation of different VIPs;    -   Allocation of different services, different service versions, or        state changes for existing services.

Autognome will detect changes in control resources and retrieve new onesonly when changed, and when new control resources are consumed it willdetect those aspects of the new configuration which are different fromits current state, and apply only the changes. First, items that are notpart of the new configuration are brought down (which may involve awind-down phase):

-   -   If the cluster changed, then there may be agents from the old        cluster that are no longer members of the new cluster and these        will be deleted from the set of agents that the local HB will        monitor.    -   Current VIPs/ports not in the new configuration will be shut        down (they will be deleted from the configuration files read by        HB and other services will be notified that certain VIPs/ports        are no longer active and they will stop listening to them).    -   Currently running service versions which are not in the new        configuration will be stopped.

At this point the machine is in a state reflecting the intersection ofthe old and new state. What remains is to add new items that were not inthe old state.

-   -   New agents are added to the list of agents monitored by HB by        writing to the file that HB uses to detect cluster changes.    -   New VIPs/ports are configured by HB by writing to the file that        HB uses to define the VIPs in the cluster.    -   New services are launched into their target state and existing        services may be moved into new states by running service        specific commands (or Autognome may leave it to the services to        detect their new target states).

It should be appreciated that the process of moving from the oldconfiguration to the new may follow a different order, for instancestarting new services prior to taking down old ones, due to the specificrequirements of the service and the state of the network.

Services

Service States

Each service has a service-level state, a VIP/port level state for eachunique VIP/port, and a state per request collection. The value of eachof these state variables is taken from a discrete set of states thatdepends on the type of state variable and type of service.

The service can be commanded to a different state (at the service level,VIP/port, or request collection level) either via an argument in thecommand that launches the service, via a configuration retrieved fromthe control network, or via a management command. The actual mechanismsavailable, and the meaning of different states, are dependent on theservice type.

New Service Initialization

Each service instance will be launched with arguments specifying aservice identifier, a control node to contact, and a target initialstate. Once launched, the service will contact the control node for itsconfiguration, which will contain:

-   -   the control nodes to contact for future instructions;    -   a new target state;    -   the event reducers to which to send service state change events;    -   a manifest of other control resources with version information,        listing separately retrievable control resources that specify:        -   VIPs/ports to listen to for connections;        -   layered request configurations (an LCO per layer), which may            lead to a large number of other configuration objects being            retrieved based on the requests this service is supposed to            handle;        -   the client certificate to use for future control contacts;        -   Potentially many other things, depending on the nature of            the service the cluster is to join and the VIPs and ports to            configure.

Service Reconfiguration

Once initially configured, a service instance will periodically poll itsassigned control node for configuration changes. Additionally, someservices may provide management interfaces through which configurationchanges can be pushed to the service. The net effect of either of theseis that the service will detect differences between its current (old)configuration and its new one, and it will apply only the changes.

Modifying the Flavor of a Machine

As discussed above, a machine may have multiple flavors and a machinemay change flavors. In general, as part of a flavor change for amachine, any and all of the services running on that machine (except forthe Autognome service (S0)) may be terminated, and any possible CDNservices may be initiated. For example, a machine that is running acaching service may be modified to also run a reducer service. Asanother example, a machine that is running multiple reducer services maybe modified to run an addition reducer service. As yet another example,a machine that is running caching services may be modified to runrendezvous services (and no caching services).

The flavor change of a machine may be initiated by the control mechanisminteracting with the Autognome service (S0) running on that machine,whereby the control mechanism tells the machine what services it shouldbe running. As described above, Autognome is a service that runs on allCDN machines and determines (at 2464-2462, FIG. 24-K) whetherconfiguration changes (i.e., service changes) on a machine are required.For example, having received instructions from the control mechanism (at2464), Autognome will terminate services, as needed, and will initiateneeded new services (at 2462). New services may be initiated in the samemanner as for new machines (discussed above with reference to FIGS. 24-Ato 24-H). In some cases the new services may be started while themachine is still running. In other cases, the machine may have to berestarted before the new services can begin their operation.

Instructions to the Autognome service (S0) to modify a machine's flavormay be obtained from the control mechanism. The control mechanism maydetermine that a machine should change its flavor (run different and/orother services) based on information determined from event streamsprocessed by the CDN. For example, as shown in FIG. 2-D, the Autognomeservice (S0-A) receives control information (C) from the controlservices. That control information may have been determined from eventstreams from any/all other CDN services. For example, the control maydetermine, based at least in part on event information, that aparticular rendezvous service is not active. In that case the controlmechanism may determine that one of the other machines in the CDN shouldprovide rendezvous services. The control mechanism selects a machine(e.g., a machine currently providing caching services) and instructs theAutognome service (S0) on the selected machine to change that machine torun rendezvous services. The machine may be selected, e.g., based on itsload. For instance, a lightly loaded caching service may be terminatedwithout much loss of effective network capacity. The Autognome service(S0) on the selected machine terminates the caching service that wasrunning on that machine and starts up a rendezvous service on thatmachine. As noted, service termination may follow certain protocolsbased on the type of service and on the urgency of the change. In somecases the rendezvous service may be started before the caching serviceis terminated.

Termination of Services

As discussed above, with reference to FIG. 24-F, when a machine isinstructed to terminate certain services, that machine may need toperform a clean shut-down process (i.e., a wind down 2434). For example,the machine may need to continue some or all of those services in orderto satisfy current and ongoing requests. Timeout(s) or thresholds may beused to constrain the wind down period, based in part on the type ofservice and the desired state of the machine after service termination.

The Executive

It is anticipated that in a CDN a cache machine with a 10 Gb/sec link,serving about 1 Mb/second per client, should be able to serve on theorder of 10,000 concurrent clients, with about ten (10) activities perclient. This requires on the order of 100,000 concurrent activities. Theinventors realized that in order for a cache machine (and thus a CDN) tooperate efficiently and to take advantage of new multi-core computerarchitectures, the cache machine would have to implement some efficientform of concurrency.

More specifically, and based on their experience with CDNs, theinventors realized and understood that network applications (e.g.,serving and distributing content in a CDN) typically involved long waitperiods. They therefore realized that it would be useful to perform manysmall jobs in order to be efficient (i.e., in the case of a CDN cache,it would be beneficial to do tens or even hundreds of thousands ofthings concurrently). They also realized that it would be useful andbeneficial to keep all processors (CPUs) active simultaneously. Theinventors realized that the handling of an individual request in thistype of application generally consists of small amounts of computationseparated by relatively long wait times (long here being relative to thespeed of modern CPUs). Therefore, while requests are in the waitingstage, other requests can be in the compute stage, thereby keeping theCPUs busy. However, not all requests require long wait times, and that aconcurrency scheme that assumed that there would always be long waittimes would disadvantage those requests where there were no long waittimes.

A concurrency scheme used in caches could take advantage of the type ofwork that caches were expected to perform in order to improveperformance. For example, most network applications have similarstructure and most network operations take on the order of milliseconds.A cache could perform useful operations while waiting for relativelyslower network operations or disk operations to complete. (Diskoperations sometimes take longer than milliseconds.) In addition,networking (and the timing in large networks such as the Internet) isinherently and largely unpredictable and unreliable. To deal with theseaspects, a preferred concurrency scheme should support asynchrony (todeal with unpredictable timing) and organized exception handling (todeal with lots of potential failure modes and unreliability ofnetworks).

The inventors considered approaches such as one thread per client to betoo limiting for challenges of real-world caches in operational CDNs. Ina thread-per-client model each client consumes an inordinate amount ofsystem resources while spending most of its time waiting (e.g., fornetwork or disk I/O).

Those of ordinary skill in the art will realize and understand, uponreading this description, that these other approaches to concurrency maywork for smaller caches or CDNs, but they do not scale well. Thus, whilethe disclosed executive approach is preferred, other approaches arecontemplated and may be used.

The presently preferred version of the Executive assumes a 64-bit CPUwith 64-byte cache lines. Basic data structures are all cache-line sizedand aligned. While this approach improves efficiency with respect toretrieving data, moving it around, and storing it, it may force someoverloading of data fields within data structures. Those of ordinaryskill in the art will realize and understand, upon reading thisdescription, that other implementations may be used.

Tasks, Events, and Vcores

The basic objects in the Executive are tasks, events, and vcores(Virtual CPU cores). FIGS. 25-A-25-B show relationships between theExecutive's tasks, events and vcores.

A virtual CPU core (or vcore) may be considered, in some aspects, to belike a pthread with some data. There may be any number of vcores,although the Executive is expected to be most efficient when there isone vcore per physical core, with each vcore bound to or associated witha fixed physical core.

In order to support synchronization, each vcore is assigned a vcoreidentifier (vid), and each task has a vid field that specifies the vcoreto which that task belongs.

Each task has a corresponding input event list. For example, as shown inFIG. 25-A, the task block T has a list of three events (denoted E1, E2,E3 in the drawing).

Each vcore has a prioritized list of tasks called its run queue. E.g.,FIG. 25-B shows vcore no. 2 with a run queue comprising a number oftasks (denoted T1, T2, T3), each with a corresponding event list (E11for task T1, E21 and E22 for task T2, and E31 for task T3). One task(T4) is currently running, and a number of tasks (T5 . . . T6) arewaiting. The task block T in FIG. 25-A is shown with VID=2 (i.e., thattask is associated with vcore no. 2).

An Executive task is described by a function pointer (ƒ), a data pointer(d), and some other (e.g., task accounting) information. A task may berun by invoking the function on the data (e.g., ƒ(d)). Each task has atask identifier or handle (tid). With reference to the exemplary taskstructure in FIG. 25-C, preferably a task is packed into a 128-bytestructure, and is identified by a 4-byte integer task handle (“tid” ortask id).

Channels are a special type of Executive task. A channel task containspointer to “Channel Information Block” (chib). Each chib ischannel-type-specific, and contains methods for:

-   -   dropoff (asynchronous), submission (maybe synchronous) and        return (deliver) of events (where the events being returned are        being returned to a channel from another channel)    -   timeout    -   close, destroy    -   migrating    -   create entry point    -   and various others.

Channels have flags set and have the wake/chib field points to a chib.User tasks have no flags, whilst the wake/chib field points to thewakeup predicate (this is an example of the field overloading referredto earlier). Prio determines where a task gets placed on the run queue.

The channel types may include some or all of the following:

-   -   Network        -   serv (passive listener)        -   conn (active connection)        -   udp (datagram)        -   resolv (DNS resolver)        -   SSL Channel        -   General buffer channel        -   Connection channel    -   Async I/O        -   aios (aio slave)        -   aio (aio master)    -   HTTP        -   fpnsh_conn (HTTP parser and formatter)    -   Application Specific, e.g., for cache:        -   the sequencer channel (manages running of handlers)        -   various Lua-related channels (handle dealing with Lua            engines and running them)

In some embodiments, the Async IO channels may be performed by the IOlibrary. An aios and aio channel may not be used, and a separatenon-Executive library (libfpio) will handle asynchronous I/O.

As used herein “cid” refers to a “channel id” and “tid” means a “taskid”. In practice, the “cid” field may be used as the “to” address andthe “tid” field is used as the “from” address of an event. There arecases of both task-to-task and channel-to-channel communication where a“cid” may actually be a task id, and vice versa.

The task structure is preferably cache line aligned. In the drawing(FIG. 25-C), the function pointer is denoted func. A task structure mayhave additional space for use as scratch space. In an implementation, atask structure is 128 bytes, of which 48 bytes free for task use,although a given task is always free to allocate more memory for itselfand keep track of it by placing a pointer in the task structure.

Every task contains a reference counter (refs), and a task dies if it isdispatched with its reference counter set to zero (refs==0). A reference(also known as “cid” or channel id, also known as “tid”) is a copy ofthe integer id of a task and is created when the task is created, orwhen a task itself calls ns_tid_alloc( ). A reference is destroyed whenreturned to the task during close or discard or the task itself callsns_tid_free( ). Those of ordinary skill in the art will realize andunderstand, upon reading this description, that the function names areprovided here by way of example only, and are not intended to limit thescope of the system in any way.

Reference are capabilities that should not be duplicated or destroyedand should be carefully tracked. They are used in the tid and cid fieldsof events.

The Executive uses counting references to prevent stale references (theyare an Executive analog of locks).

An event is a message block (preferably 128 bytes, including 64 bytesfor scratch space) and contains two task references (two tids), one forthe initiator task (tid) and the other for the target task (cid). The64-byte scratch space may be divided into internal and external scratchspace. Events may be linked.

In operation, each vcore thread runs an endless loop and:

-   -   retrieves (e.g., pops) the highest priority task t from its run        queue;    -   calls t->ƒ(t);    -   calls ns_dispatch(t) to requeue, destroy or abandon the task t.

The following two rules should ensure memory consistency:

-   -   Access rule: If another task has the same vid as you, you can        safely access its data.    -   Migration rule: Only vcore n can change a vid value to or from        n.

The Executive is started on a host by creating an appropriate number ofvcores for that host and then starting the first task. E.g., to startthe Executive with n vcores, call:

ns_begin(first_task_func,n);

The first task creates and launches more tasks and channels, e.g., asfollows:

  first_task_func( ) { t = ns_task( ); ns_launch(t); cid1 =ns_chan(foospec, 0); . . . }

Tasks and channels create events and communicate with each other:

  e = ns_event( ) e->cid = cid1 ns_dropoff(e)

Tasks, channels and events are created and die as necessary.

ns_task( );ns_chan( );ns_event( );return ns_die( );

In a preferred implementation, the Executive will exit when the lasttask exits.

There are two styles of communication within the Executive, namelyguaranteed asynchronous communication and potentially asynchronouscommunication.

Guaranteed asynchronous communication puts an event on the input queueof a destination task, and wakes the destination task, i.e., puts it onthe run queue. The destination task runs (later) and an event arrivesback on the input queue of the source task. It should be appreciatedthat the source task may choose to send the event “anonymously” (thatis, without a tid), in which case no response will return. Anotheroption is for the source task to provide the tid of some third task towhich the event will be delivered once the destination task is done withit. This type of communication is lightweight and non-blocking E g.,ns_event_dropoff(e) uses e->cid as destination; ns_event_deliver(e) usese->tid as destination. Basically, ns_event_dropoff is used by tasks todrop an event off to a channel, and ns_event_deliver is used by tasks toreturn events to whoever sent them.

Potentially asynchronous communication is invoked, e.g., by

e=ns_submit(e).

This approach works as follows:

S1 Passes event to destination task S2 Suspends current task S3 Executesdestination task instead S4 Event pointer returned as function returnvalue S5 Resumes current task.

Potentially asynchronous communication can go asynchronous by returningnull pointer in step S4, and delivering the event later.

Communication reverts to asynchronous if, e.g., the destination task isnot on the same vcore, or there is too much work to do in one run, orthe task needs to wait for internal asynchronous operations. It shouldbe appreciated, however, that synchronous operation may, in some cases,be achieved even if the destination is a different vcore.

The destination does not know/care if it was called via dropoff( )(i.e., as Guaranteed asynchronous) or submit( )(i.e., as Potentiallyasynchronous). Events always arrive on the input queue, which isaccessed via ns_next_event( ). Events are returned by channels usingns_event_deliver( ). If the destination is a channel, it can knowwhether an event was dropped off or submitted, since these are separatechib entry points which can be overridden.

Events can be transferred, e.g., using the following code:

ns_event_t *e = ns_event( ); e->tid = ns_ tid( ); e->cid = some_cid;some_cid = 0; e->opcode = Executive_OP_READ_BUFFER; e->timeout = 5.0;e->ns_buf_arg = malloc(1024); e->ns_buf_count = 1024; e = ns_submit(e);

This example demonstrates care about reference counting. Since some_cidrepresents a reference and that reference has been transferred toe->cid, the value of some_cid gets zeroed.

This event transfer may be wrapped in a function, e.g., as:

  ns_event_t *e = ns_event( ); e->tid = ns_tid( ); e->cid = some_cid; e= ns_submit_1k_read(e, 1024);

Event Driven Programs

The following code shows a basic “loop-switch” skeleton for an Executivetask function presented in a ‘C’ like language:

  task_func(t) {  while((e = ns_next_event( ))) {  switch(event_type(e)) {    case TYPE0:    . . .    break;    . . .   case TYPEn:    . . .    break;   }   ns_return(e);  }  returnns_wait( ); }

The following example code shows a basic “loop-switch” skeleton for anExecutive task function with submit( ):

  task_func(t) {  e = 0;  while(e | | (e = ns_next_event( ))) {  switch(event_type(e)) {    case TYPE0:    e = submit(e);    continue;   . . .    case TYPEn:    . . .    break;   }   ns_return(e);  } return ns_wait( ); }

FIGS. 25-D-25-E compare the Executive stack of the Executive submitoperation to that for C procedure calls. The Executive Submit operation(e=submit(e)) is analogous to a C procedure call, with the importantdifference that there is the option to go asynchronous when an event issubmitted. The Executive's task blocks are analogous to C stack frames.The Executive's event blocks are analogous to C's arg and return addressareas; and the Executive's tid & tag are analogous to C's returnaddress.

However, in the Executive multiple calls can be active simultaneouslyand frames can live on after the call. This allows writing a potentiallyasynchronous hook, e.g.,

e=submit_op_foo(e,ergs);

Channels may be created using a parameter block called a spec, e.g.:

ns_foo_t *spec = ns_foo( ); /* create spec for foo channel */spec->param1 = val1; /* set parameter */ spec->param2 = val2; /* setparameter */ cid = ns_chan(spec, 5); /* create foo chan, return 5 refs*/ns_foo_(spec); /* destroy spec */

A channel may be closed by returning the refs, e.g.:

ns_close_cid(cid, 4);/* Explicit close, 1 + 4 refs */ns_discard_cid(cid, 1);/* Return 1 + 1 refs */ ns_discard_cid(cid, 2);/*Return 1 +2 refs, implicit close */

A channel will not be destroyed until all refs have been returned.

A global exchange (e.g., as shown in FIG. 25-F) may be used to transferpointer ownership between vcores. Typed pointers are packed into cachelines which are used to transfer the pointers efficiently, viamutex-protected queues. While various techniques are used to make theglobal exchange efficient, e.g., amortization of lock cost bytransferring multiple messages with a single lock transaction, lock-freeinspection of a queue to see if there may be data (only need the lock ifdata is seen), etc., it should be appreciated that a “direct exchange”is preferable, and that the queues involved may be created usinglock-free techniques.

The following example shows synchronization in task migration. In thisexample, task t wants to migrate from vid=2 to vid=3.

-   -   Initially t->vid=2.    -   t func sets t->vid=1003 and returns Executive RUN.    -   ns-dispatch( ) notices t->vid≠2 and puts (t, RUN, 3) on global        exchange.    -   Global exchange transfers the triple to vcore 3.    -   Vcore 3 sets t->vid=3 and adds task to its run queue.

Note that t->vid is initially set to 1003 and then set to 3. Recall thatif a task observes that another task has the same vid as it does, thenit is then safe for that task to look at the other task's data. However,in the migration case, the migrating task cannot just set its vid to thetarget vid because then there will be a time when it has not yetmigrated but its vid equals the vid of a vcore on which it is not yetrunning. Accordingly, in this example, temporarily setting the vid to“1003” acts as a signal to the dispatcher to migrate to vcore 3 withoutactually setting the vid for that task to 3 (“1003” does not match anyvalid vid value, and indicates a migration request to dispatcher). Oncethe migration is complete (and the task is running on vcore 3), the“1000” is removed and the vid becomes 3.

The Executive provides a multi-core solution in which each processor(CPU) has a queue of tasks which can run on that processor (in avcore—virtual core on that processor). Processes can check if otherprocesses are running on the same core and then determine/shareinformation with those processes.

In some embodiments, a vcore migration technique (also referred to as a“vcore walk”) may be used to coordinate read/write access to shared datato avoid the overhead of traditional locking techniques. In theseembodiments, a set of pointers to the data structure is maintained, onepointer per vcore, and whenever a task wishes to access the datastructure, it uses the per-vcore pointer for the core on which it isrunning Tasks are not allowed to separately hold per-vcore pointers(e.g., cannot put a copy of those pointers into their own states). Then,when a task wishes to change the shared data structure, it creates a newdata structure (e.g., by copying the existing data structure andmodifying it), arranges to be migrated to all the vcores, and thenchanges each of the per-vcore pointers to point to the new datastructure. Once the migration (and “vcore walk”) is complete, it is safefor this task to free the old data structure (since no task is allowedto hold on to the pointer to the old data structure).

This technique does result in a short period where tasks running ondifferent vcores will not see the same data structure; however, thatshould rarely be an issue, and is application-specific.

A variation of this technique involves a case where the per-vcorepointer points to a reference-counted data structure. In that case, atask can grab a reference and safely hold on to the pointer until itdrops the reference.

In prior concurrency/parallel processing systems, tasks or processes getspawned off and return when they are complete. An important aspect ofcache processing, especially in the context of a CDN, is that some tasksmay be able to complete right away. In those cases there is no reason todelay the return. In other words, if the system knows that a task mightcomplete its processing right away (i.e., relatively quickly), thesystem can have that task provides its result without delay.

One example of the use of this technique is when a Lua script isexecuted: in many cases, the script may perform such a small operationthat it can complete essentially right away, which saves the overhead ofneeding to schedule it as a task unless that becomes necessary. Anotherexample of this technique is in the sequencer channel: If a series ofhandlers runs quickly, then calling the sequencer is essentially afunction call. Only if a handler needs to wait for data or if too muchcomputation needs to get done will the sequencer become a scheduledtask.

This may be achieved by the following:

  if(event = submit(event)) == null)  return ns_wait( ); // if non-nullthen done, otherwise wait.

This approach (do it right away if you can, otherwise give me the answerlater) provides a potentially asynchronous solution to cache specificproblems.

Additionally, programming in a “potentially asynchronous” style meansthat if it is later determined that some feature or aspect (which wassynchronous previously) needs to go asynchronous, this can be donewithout having to rewrite other code. Those of ordinary skill in the artwill realize and understand, upon reading this description, that thereare costs/risks to this approach, e.g., if only the synchronous path istaken in a given situation, the asynchronous path may be untested or theperformance of the application may degrade if a previously synchronousoperation becomes asynchronous. However, these risks can be mitigated,e.g., by forcing everything to be asynchronous for testing purposes.

In some preferred embodiments, the Executive is implemented using asystem sometimes referred to as Shell or NetShell. It should beappreciated that the Executive and NetShell described herein areunrelated to any products or tools of any other entity. In particular,as used herein NetShell does not refer to Microsoft Corporation'sscriptable command-line tool, nor does executive or NetShell refer to aUnix shell-like user interface.

Computing

The services, mechanisms, operations and acts shown and described aboveare implemented, at least in part, by software running on one or morecomputers of CDN 100.

Programs that implement such methods (as well as other types of data)may be stored and transmitted using a variety of media (e.g., computerreadable media) in a number of manners. Hard-wired circuitry or customhardware may be used in place of, or in combination with, some or all ofthe software instructions that can implement the processes of variousembodiments. Thus, various combinations of hardware and software may beused instead of software only.

One of ordinary skill in the art will readily appreciate and understand,upon reading this description, that the various processes describedherein may be implemented by, e.g., appropriately programmed generalpurpose computers, special purpose computers and computing devices. Oneor more such computers or computing devices may be referred to as acomputer system.

FIG. 26-A is a schematic diagram of a computer system 2600 upon whichembodiments of the present disclosure may be implemented and carriedout.

According to the present example, the computer system 2600 includes abus 2601 (i.e., interconnect), one or more processors 2602, one or morecommunications ports 2603, a main memory 2604, removable storage media2605, read-only memory 2606, and a mass storage 2607. Communication port2603 may be connected to one or more networks 2617 by way of which thecomputer system 2600 may receive and/or transmit data.

As used herein, a “processor” means one or more microprocessors, centralprocessing units (CPUs), computing devices, microcontrollers, digitalsignal processors, or like devices or any combination thereof,regardless of their architecture. An apparatus that performs a processcan include, e.g., a processor and those devices such as input devicesand output devices that are appropriate to perform the process.

Processor(s) 2602 can be any known processor, such as, but not limitedto, an Intel® Itanium® or Itanium 2® processor(s), AMD® Opteron® orAthlon MP® processor(s), or Motorola® lines of processors, and the like.Communications port(s) 2603 can be any of an RS-232 port for use with amodem based dial-up connection, a 10/100 Ethernet port, a Gigabit portusing copper or fiber, or a USB port, and the like. Communicationsport(s) 2603 may be chosen depending on a network such as a Local AreaNetwork (LAN), a Wide Area Network (WAN), a CDN, or any network to whichthe computer system 2600 connects. The computer system 2600 may be incommunication with peripheral devices (e.g., display screen 2630, inputdevice(s) 2616) via Input/Output (I/O) port 2609.

Main memory 2604 can be Random Access Memory (RAM), or any other dynamicstorage device(s) commonly known in the art. Read-only memory 2606 canbe any static storage device(s) such as Programmable Read-Only Memory(PROM) chips for storing static information such as instructions forprocessor 2602. Mass storage 2607 can be used to store information andinstructions. For example, hard disks such as the Adaptec® family ofSmall Computer Serial Interface (SCSI) drives, an optical disc, an arrayof disks such as Redundant Array of Independent Disks (RAID), such asthe Adaptec® family of RAID drives, or any other mass storage devicesmay be used.

Bus 2601 communicatively couples processor(s) 2602 with the othermemory, storage and communications blocks. Bus 2601 can be a PCI/PCI-X,SCSI, a Universal Serial Bus (USB) based system bus (or other) dependingon the storage devices used, and the like. Removable storage media 2605can be any kind of external hard-drives, floppy drives, IOMEGA® ZipDrives, Compact Disc-Read Only Memory (CD-ROM), Compact Disc-Re-Writable(CD-RW), Digital Versatile Disk-Read Only Memory (DVD-ROM), etc.

Embodiments herein may be provided as one or more computer programproducts, which may include a machine-readable medium having storedthereon instructions, which may be used to program a computer (or otherelectronic devices) to perform a process. As used herein, the term“machine-readable medium” refers to any medium, a plurality of the same,or a combination of different media, which participate in providing data(e.g., instructions, data structures) which may be read by a computer, aprocessor or a like device. Such a medium may take many forms, includingbut not limited to, non-volatile media, volatile media, and transmissionmedia. Non-volatile media include, for example, optical or magneticdisks and other persistent memory. Volatile media include dynamic randomaccess memory, which typically constitutes the main memory of thecomputer. Transmission media include coaxial cables, copper wire andfiber optics, including the wires that comprise a system bus coupled tothe processor. Transmission media may include or convey acoustic waves,light waves and electromagnetic emissions, such as those generatedduring radio frequency (RF) and infrared (IR) data communications.

The machine-readable medium may include, but is not limited to, floppydiskettes, optical discs, CD-ROMs, magneto-optical disks, ROMs, RAMs,erasable programmable read-only memories (EPROMs), electrically erasableprogrammable read-only memories (EEPROMs), magnetic or optical cards,flash memory, or other type of media/machine-readable medium suitablefor storing electronic instructions. Moreover, embodiments herein mayalso be downloaded as a computer program product, wherein the programmay be transferred from a remote computer to a requesting computer byway of data signals embodied in a carrier wave or other propagationmedium via a communication link (e.g., modem or network connection).

Various forms of computer readable media may be involved in carryingdata (e.g. sequences of instructions) to a processor. For example, datamay be (i) delivered from RAM to a processor; (ii) carried over awireless transmission medium; (iii) formatted and/or transmittedaccording to numerous formats, standards or protocols; and/or (iv)encrypted in any of a variety of ways well known in the art.

A computer-readable medium can store (in any appropriate format) thoseprogram elements which are appropriate to perform the methods.

As shown, main memory 2604 is encoded with application(s) 2650-1 thatsupports the functionality as discussed herein (the application 2650-1may be an application that provides some or all of the functionality ofthe services described herein, e.g., a control service, collectorservice, reducer service, rendezvous service and/or caching service).Application(s) 2650-1 (and/or other resources as described herein) canbe embodied as software code such as data and/or logic instructions(e.g., code stored in the memory or on another computer readable mediumsuch as a disk) that supports processing functionality according todifferent embodiments described herein.

For example, as shown in FIG. 26-B, application(s) 2650-1 may includeAutognome application(s) 2681-1, control service(s) applications 2680-1,collector service(s) applications 2682-1, reducer service(s)applications 2684-1, rendezvous service(s) applications 2686-1 and/orcaching service(s) applications 2688-1.

During operation of one embodiment, processor(s) 2602 accesses mainmemory 2604 via the use of bus 2601 in order to launch, run, execute,interpret or otherwise perform the logic instructions of theapplication(s) 2650-1. Execution of application(s) 2650-1 producesprocessing functionality of the service related to the application(s).In other words, the process(es) 2650-2 represent one or more portions ofthe application(s) 2650-1 performing within or upon the processor(s)2602 in the computer system 2600.

For example, as shown in FIG. 26-C, process(es) 2650-2 may includeAutognome process(es) 2681-2, control service(s) process(es) 2680-2,collector service(s) process(es) 2682-2, reducer service(s) process(es)2684-2, rendezvous service(s) process(es) 2686-2 and/or cachingservice(s) process(es) 2688-2.

In other words, when the application(s) 2650-1 include controlservice(s) applications 2680-1, the process(es) 2650-2 may includecontrol service(s) process(es) 2680-2, when the application(s) 2650-1include collector service(s) applications 2682-1, the process(es) 2650-2may include collector service(s) process(es) 2682-2, and so on.

Since a machine (computer) may run multiple CDN services at the sametime (depending on its flavor), the applications 2650-1 and thecorresponding processes 2650-2 may include applications and processescorresponding to more than one kind of CDN service.

With reference again to FIG. 2-A, the application(s) 2650-1 preferablyincludes the applications for services S0 (Autognome), S1 . . . Sk, andthe applications 2650-2 include the corresponding services running onthe computer.

It should be noted that, in addition to the process(es) 2650-2 thatcarries(carry) out operations as discussed herein, other embodimentsherein include the application 2650-1 itself (i.e., the un-executed ornon-performing logic instructions and/or data). The application 2650-1may be stored on a computer readable medium (e.g., a repository) such asa disk or in an optical medium. According to other embodiments, theapplication 2650-1 can also be stored in a memory type system such as infirmware, read only memory (ROM), or, as in this example, as executablecode within the main memory 2604 (e.g., within Random Access Memory orRAM). For example, application 2650-1 may also be stored in removablestorage media 2605, read-only memory 2606, and/or mass storage device2607.

Those skilled in the art will understand that the computer system 2600can include other processes and/or software and hardware components,such as an operating system that controls allocation and use of hardwareresources. For example, with reference again to FIG. 2-A, the coreprograms including the kernel 304 and other core programs 306 may beprocesses on the computer system.

As discussed herein, embodiments of the present invention includevarious steps or operations. A variety of these steps may be performedby hardware components or may be embodied in machine-executableinstructions, which may be used to cause a general-purpose orspecial-purpose processor programmed with the instructions to performthe operations. Alternatively, the steps may be performed by acombination of hardware, software, and/or firmware. The term “module”refers to a self-contained functional component, which can includehardware, software, firmware or any combination thereof.

One of ordinary skill in the art will readily appreciate and understand,upon reading this description, that embodiments of an apparatus mayinclude a computer/computing device operable to perform some (but notnecessarily all) of the described process.

Embodiments of a computer-readable medium storing a program or datastructure include a computer-readable medium storing a program that,when executed, can cause a processor to perform some (but notnecessarily all) of the described process.

Where a process is described herein, those of ordinary skill in the artwill appreciate that the process may operate without any userintervention. In another embodiment, the process includes some humanintervention (e.g., a step is performed by or with the assistance of ahuman).

CDN Virtualization, Interconnection, Delegation, and Federation

The ongoing proliferation of CDNs demands the means to interconnectthem. As shown above, in some cases a CDN may be treated as sub-CDNs.Those of ordinary skill in the art will realize and understand, uponreading this description, that a CDN as described here can be configuredto handle various modes of CDN interconnection.

Basic Mechanisms

Hierarchical Partitioning of Virtual CDNs

A single autonomous CDN can be partitioned into multiple virtual CDNsorganized into a hierarchy with varying degrees of overlap. Theconfiguration interfaces are used to create the CDN hierarchy, allocateseparate physical clusters, configure services, and bind properties tothe services in each CDN. A parent CDN may grant privileges to each ofits child CDNs. In other words, a user with the authority to configurethe parent CDN configures it such that it grants specific privileges toits children, or not. Grantable privileges include the authority to:

-   -   run specific service types;    -   manage specific hardware resources (machines, clusters);    -   bind specific properties to specific service types;    -   use services inherited from the parent (for requests related to        certain properties);    -   grant specific privileges to other descendant CDNs.

These privileges are subject to expiration, revocation, and renewal. Thenet effect of allocating resources and granting privileges to a CDN isto provide it with a set of service types it can run, a set of machinesit can run them on, a set of properties that can be bound to eachservice type, and a set of rules constraining interactions with itsparent.

Defining a virtual CDN puts a physical boundary on the resources used todeliver content for a set of properties, constraining the set of bindingassignments that can be made (properties allocated to the CDN must bebound to resources allocated to the CDN). Allocating services tomachines and binding properties to services is then the responsibilityof the individual CDNs (or whatever CDN was allocated the responsibilityof running the configuration service for the CDN's pool of resources).

When a child service or an external client attributable to the childissues a request to a parent service, the parent may be configured tohandle the request, proxy the request to some other service, or redirectthe request to some other service (where the other service could be inthe child or in another accessible CDN). The exact nature of theproxying or redirection depends on the service type.

When a parent and child both have instances of the same service type,the option exists for those instances to collaborate across CDNboundaries. For example, considering the rendezvous service type:

-   -   A DNS rendezvous request to the parent could respond with a VIP        in the parent or child CDNs, or it could redirect (via a CNAME        and NS records) to the rendezvous service of the child, which        then decides on the VIP. The same could happen in the other        direction (child DNS request is redirected to the parent), or        one side could proxy the request to the other.

This same interaction pattern exists for requests of most other servicetypes, too, including configuration updates, control resource retrieval,event stream delivery, collector service requests, and, of course, cacherequests. If the service type only exists at one side or the other ofthe CDN boundary, then there are fewer options. Again taking rendezvousas an example:

-   -   If the parent has rendezvous but the child does not, clients of        the child must be configured to use the parent's rendezvous,        which must be able to route requests to either the parent or        child CDN. If the child has rendezvous but the parent does not,        the same thing applies.

In both of these latter cases it is as if the parent and child are oneCDN, at least as far as the service type in question is concerned.

Peer-to-Peer Interconnection of CDNs

A simple adaptation of the principles described in the previous sectioncan be applied to implement peer to peer interconnection. In this case,one peer grants authority to use certain services for certain propertiesto another peer, and vice versa. In this case there is no allocation ofphysical resources, just mutual service collaboration. The desire tointeract can be initiated by either side, handled either via agrant/accept or a request/grant protocol.

Peer-to-Peer Interconnection with Foreign CDNs

Peer-to-peer interconnection of heterogeneous CDNs, at least as definedby the IETF CDN Interconnection model (CDNi), is less general than theallocation and sharing mechanisms described in the previous section andmore focused on content peering. In the CDNi model there is no attemptto share services, heterogeneous CDNs just exchange information betweenpeer services of the same type.

Given that we are only interested here in how a CDN might interact witha foreign CDN, all that is needed is to bridge the capabilitiesdescribed above and elsewhere to integrate with similar capabilities ina foreign CDN. No fundamentally new capabilities are required.

The CDNi view of collaboration between two autonomous CDNs is asfollows. Given two CDNs A and B and one original content provider P, andassuming A is the authoritative (upstream) CDN for provider P, the ideais that an end user E's request to A could be redirected to B if Athinks that B is in a better position to serve P's content to E and aCDN interconnection agreement is in place between A and B. Thisredirection could theoretically happen at the DNS and/or HTTP level. Ifa redirection occurs, B may in turn request the content back from Aanyway if it doesn't have it cached, and A then requests the contentfrom P. In this case, the authoritative CDN A acts both as the initialrendezvous layer and as a parent cache layer for requests to provider Pfrom clients of CDN B. CDN A needs access to B's logs because it wantsto be able to bill P for content that was delivered from B's cachewithout A's knowledge. Each of these interactions is analogous to theservice sharing scenarios described earlier.

For this to work, some control and metadata exchange interfaces betweenthe two CDNs need to be established. The same goes for log dataexchange.

For the rendezvous and content delivery parts of the integration, astraightforward approach might be to model the foreign CDN as a virtualCDN with either an unknown set of resources or knowledge of the specificresources but no control over their bindings, and grant the necessaryprivileges back and forth to enable exchange of binding information, DNSredirection, and cache filling to occur across CDNs

Product Deployment Options

Internet Localization and Deep Edge Caching

Deep Edge Caching is currently the deployment of caching equipment inISP networks to provide Content Localization services (i.e., to minimizethe need for content to move into the ISP customer's network and therebyreduce transport costs). Rendezvous is customized based on informationprovided about the ISP's DNS resolvers and associated client IPaddresses, and the machines are initially manually configured over aremote connection. The machines are normally configured to only delivercontent to the ISPs customers.

A Deep Edge Cache is a child CDN which relies on its parent forconfiguration, control, log collection, and rendezvous.

Delegation

Delegated CDN is the integration of ISP-owned and operated cachingequipment in ISP networks. The caching equipment in this case could be alicensed version of a cache, or a 3rd party cache that has beenintegrated with a CDN. A delegated CDN would be configured similarly toa deep edge cache, but the work would be performed by the ISP.

This is the same as Deep Edge Caching if the equipment is not foreignequipment. If the equipment is foreign, use the virtual child CDN withunknown resources, and let the foreign (child) CDN use its parent'sservices.

Federation and Exchange

CDN Federation is just multilateral CDN interconnection, and in thatsense it is just a collection of pairwise CDN interconnections. A CDNExchange is a special case of CDN Federation (with a distinguished CDNacting as the exchange between multiple other CDNs).

Trust and Security

The various machines/services that form a CDN or part thereof need totrust each other. For example, each service that provides data (e.g.,event, state, control, configuration, etc.) to another servicepreferably needs to trust that the service to which it is providing thedata is a trusted service. Similarly, each service that receives datafrom another service preferably needs to trust the service that isproviding it data.

Various techniques may be used to provide sufficient degrees of trustwithin a CDN and with entities external to the CDN. For example, CDentities may exchange information in order to authenticate themselveswithin the system. The control mechanism, in conjunction with a PKIsystem, may be used by machines/services to authenticate themselveswithin the CDN. Recall that each machine may include information (e.g.,certificates) to enable the control mechanism to perform authenticationas part of the machine's initial registration with the CDN. The controlmechanism preferably maintains information about each machine in the CDNand about each service running on each machine.

Those of skill in the art will realize and understand, upon reading thisdescription, that different and/or other methods may be used to achievetrust/security within a CDN, and the system is not limited by aPKI-based system. It should also be appreciated that different degreesof trust/security may be used for different aspects /components of aCDN. For example, control information may require a higher degree ofsecurity (possibly with encryption) than other types of information.

External Communication

In cases where a CDN component (e.g., a service) provides information toor receives information from an external component, additional ordifferent trust/security mechanisms may be required. For example, wheninformation is received from a component/service outside the control ofthe control system (e.g., in a delegated system), additional mechanismsmay be used to determine that the outside component can be trusted.

In addition to trust models that are used to authenticate CDN components(internal or external), various mechanisms may be applied to verify datareceived from external components. For example, a third party CDN entitymay be providing only caching/delivery services (e.g., via sub-CDN), andmay be using the CDN for control and billing purposes. It is importantto verify that the third party CDN entity was is correctly reportingdelivery of traffic sent to them. This is important because the CDN maynot want to send traffic to delivery components beyond its directcontrol unless it is confident that (a) they are up and working, and (b)their event streams come back to the CDN for settlement/billingfunctions. Rather than rely on month-end reporting to find out thatsomething is amiss (either failed components, or third-party cheating),the reducer-collector network can track and reconcile information sentto the external component(s) with information received from the externalcomponent(s). In this manner discrepancies can be caught and dealt withwhen they occur.

For example, if a third party external CDN delivery service is failing,there will be a discrepancy between requests sent to that service by theCDN's rendezvous system and content served from that service.

It should be appreciated that mechanisms used to maintain systemintegrity may also be used within the CDN.

Configuration and Control Bidirectional, Declarative, Modular, andLocalizable Configuration Maintenance

Introduction to Bidirectional, Declarative, Modular, and LocalizableConfiguration Maintenance

The CDN's control system (formed from the various control services) maybe referred to as the control core or control mechanism. The controlmechanism consists of two sides, a side dedicated to accepting andmanaging the configurations provided by users, and a side dedicated tocontrolling endpoint services (such as caches) based on establishedconfigurations. This section outlines how configuration information maybe structured and transformed from one side of the control mechanism tothe other.

The control mechanism's information model involves configuration objectswith per-schema values that are evaluated, translated into controlresource templates, and localized into final control resources (see FIG.27-A, Configuration and Control Model). Abstract configuration objectsare the entities manipulated directly by humans using configurationtools, and localized control resources are the entities consumeddirectly by endpoint services. Configuration objects have user-defined,often declarative values that may be structured in general and flexibleways involving value inheritance, inclusion, and transformation. Valueexpressions (the literal values of configuration objects) are evaluatedto expand references and perform initial variable substitutions toproduce control resource templates. A final parameter substitution stepis performed to render and localize templates into resources thatservice endpoints can use. External resources (defined outside of thecontrol and configuration realm) may be referenced to provide additionalvalues at each step in the process from configuration to control,including values that define transformation scripts.

Allowing multiple schemas with translation between them allows a givenconfigurable object to have different values reflecting the way a user'sintent is expressed differently from one schema to another. Possibleexamples of configuration object schemas include a declarative schema.Separating configuration objects from control resources and translatingbetween them allows the former to remain declarative and user-intentoriented, with the latter focused on expression in the language ofendpoint services. Finally, use of templates modularizes the controlresource generation process and compacts the resources distributed fromthe configuration to the control side of the control mechanism, andallows localized changes to be applied to control resources based ondynamically changing local contexts.

Configuration Objects

The database of configurations consists of a set of configurationobjects, with types and values defined relative to a set of metaschemasand schemas.

A metaschema defines the set of object types that exist, and defines thenamespaces of object identifiers. Every configuration object has a typedefined in the metaschema and an identifier that distinguishes it fromall other objects of the same type. Examples of types in the metaschemainclude subscribers and properties (or coservers).

A schema is a set of rules for defining configuration values for typedobjects, and there may be any number of schemas for a given metaschema.The schema defines what value expressions are legal for what types ofobjects. Each unique configuration object has multiple values, one perschema.

The value of an object in a schema may be defined explicitly via a valueexpression, or implicitly via defaulting or derivation from the object'svalue in some other schema. A value of an object may be a scalar value,an array of values, or a structure containing name/value pairs(recursively). Value expressions may also include references to multiplebase values at any point in the value expression hierarchy, providing apowerful form of modular value sharing across objects. The schemadetermines the general rules for deriving values from other schemas on atype by type basis. For example, the value of an object in schema B maybe defined to be a transformation of the object's value in schema A,unless the object explicitly defines a local value in schema B.

The literal value expression of an object in a schema is distinct fromits evaluation in that schema. Evaluation is the process of generating aground (that is, reference-free) value expression for an object in someschema by expanding value references, performing default substitutions,and invoking schema transformations.

Control Resource Generation

The evaluated values of configuration objects may be interpreted asabstract values with declarative or procedural semantics, depending onthe schema. An abstract value is transformed into an endpoint-consumablecontrol resource via two additional steps:

-   -   1. Template generation is the process of generating a template        and localizable parameter set representing a family of control        resources.    -   2. Template rendering is the process of rendering a template        with a set of actual parameter values to produce a ground (i.e.,        reference-free) control resource directly consumable by a target        service.

Template generation occurs in the configuration service, and localizabletemplates are distributed to control services for the final localizationstep (which may occur repeatedly in the same local context, if theparameters of the localization change dynamically). “Local” here meanslocal in the most general spatio-temporal sense, where parameters mayvary not just by property, client location, and service location, butalso in time.

Control Distribution

FIG. 27-B shows an example of control resource generation anddistribution, and FIG. 27-C shows an example of CCS template derivation.

Origin Server Configuration Information

Origin servers and other content sources typically do not know that theyare serving content via a CDN. Origin servers preferably provideresources to the CDN via origin services in the CD, e.g., in an origintier. In that way user/client requests are preferably made to the CDNand the CDN is responsible for obtaining content from origin servers. Tothe extent that origin servers include configuration information, e.g.,in HTTP headers, such configuration information is typically in the formof cache directives or the like. Furthermore, to the extent that originservers previously provided configuration information to a CDN, thisinformation was provided as part of an off-line set up and was performedmanually.

CDN services and CDNs may improve their performance if they know or candetermine configuration information related to resources that they areto serve, and, accordingly, it is desirable for a CDN to be able obtainconfiguration information about resources that it is going to serve.This configuration information may be provided, e.g., on a per propertybasis, a per resource basis, and/or a per origin server basis. Forexample, as described above, it may be desirable for a CDN to obtain the“vary” information from an origin server rather than to try to infersuch information.

As noted above, in some cases it may be desirable to have acommunication channel between the CDN and the origin server in order toingest policy information about variant selection performed at theorigin so that the same can be directly replicated within the CDN ratherthan being inferred from a series of responses from the origin.

Accordingly, in some embodiments, e.g., as shown in FIG. 27-D, asoftware application, e.g., a plug-in or the like, operating on anorigin server may be used to establish one or more channels to one ormore CD services in the CDN. The channel(s) is (are) preferablyencrypted and secure, and preferably the application is authenticatedand authenticatable. The origin-side application may obtainconfiguration information which can be provided via the channel to theCDN. In this manner, changes made to the configuration at the originserver may be propagated into the CDN without the CDN having to try toinfer such configuration information.

On the CDN side, the channel(s) may connect, e.g., to a control servicenetwork (comprising one or more control services) and/or CD services inan origin tier.

In operation, the CDN may use the channel(s) to the origin server inorder to obtain current configuration information, e.g., on an as neededbasis or on some regular basis. In some embodiments, the originserver-side application may push configuration information to the CDNwhen configuration changes are made or detected. For example, theapplication may monitor configuration files in a particular location todetermine if configuration changes may have been made. Preferably thisapproach is automatic, although some origin-server side operatorinteraction may be used to initiate propagation of updated configurationinformation to the CDN. In this manner, the CDN may be made aware ofconfiguration data without having to query an origin server and withouthaving to try to infer such data.

FIG. 27-E is a flowchart showing exemplary operation of an origin-serverside application according to embodiments hereof. The applicationpreferably starts automatically when the origin server begins runningand provides the then-current confirmation information to the CDN (atS2700). It should be appreciated that the information may have alreadybeen provided and so either the CDN side and/or the origin server sidemay first check to see if changes have been made since configurationinformation was previously provided to the CDN.

Configuration information may be provided, e.g., on a per propertybasis, a per resource basis, and/or a per origin server basis.Information may be provided to the CDN by one or more channels (e.g.,one or more dedicated, secure, authenticated channels), e.g., as a pushof a configuration resource to the CDN. Alternatively, the applicationmay advise the CDN of a configuration change and the CDN may fetch(e.g., pull) the configuration information from the origin server (e.g.,via a specially configured port on the origin server).

The application may be provided with one or more URLs or the likethrough which it can communicate directly to the CDN.

The application then continuously monitors for a configuration change(at S2704), and if such a change is detected, then the applicationprovides the CDN with the updated configuration information (at S2076).Preferably the information is provided in the same manner as when theapplication starts up, as described above.

In some embodiments it may be desirable for the CDN to be able to querythe application at the origin server in order to determine configurationinformation. This may occur, e.g., when the CDN does not haveconfiguration information or determines for some reason that theconfiguration information that it has is possibly invalid orinconsistent.

Thus, in some aspects, embodiments hereof may comprise acomputer-implemented method operable in a content delivery network(CDN), the method operable on one or more devices comprising hardwareincluding memory and at least one processor. The method may include, ata content source external to the CDN, wherein the CDN serves contentfrom the content source via content delivery (CD) services in the CDN,monitoring configuration information associated with content to bedelivered by the CDN on behalf of the content source, and, in responseto at least one change in the configuration information being determinedby the monitoring, the content source providing to the CDN an indicationof a change in the configuration information.

In some aspects the content source may be or comprise one or more originservers, and the configuration information may relate to configurationfor substantially all content associated with the one or more originservers.

In some aspects the content from the content source may be or compriseone or more resources. The one or more resources may be or comprise oneor more properties and the configuration information may relate toconfiguration per property of the one or more properties.

In some aspects the configuration information may relate toconfiguration per resource of the one or more resources.

In some aspects the providing of an indication may include providing atleast some of the configuration information to the CDN. The at leastsome of the configuration information may be provided by the contentsource to one or more CD services in the CDN. In some cases the at leastsome of the configuration information may be pushed by the contentsource to one or more CD services in the CDN.

In some embodiments hereof, in response to the content source providingthe indication, the CDN may obtain at least some of the configurationinformation. In some cases the CDN may obtain at least some of theconfiguration information from the content source. In some cases the CDNmay pull the at least some of the configuration information from thecontent source. In some cases the CDN may obtain at least some of theconfiguration information from a source distinct from the contentsource.

In some cases the indication may be or comprise at least some of theconfiguration information.

The monitoring may performed by a software routine associated with thecontent source. The software routine may be or comprise a plugin runningon the content source. The software routine may be co-located with thecontent source or it may be at a location distinct from the contentsource.

The software routine may provide the indication to the CDN via a channelbetween the content source and the CDN. The channel may be or comprise asecure channel that may be encrypted. In some cases the software routinemay be authenticated.

The CDN may comprise one or more configuration services, and the contentsource may provide the indication to the one or more configurationservices.

In response to the providing the CDN may modify configurationinformation associated with content from the content source.

Rendezvous Localization Via Automatic Client IP Estimation

This section provides an example of the use of the CDN architecturesdata reduction (reduce/collect) facilities. It should be appreciated,however, that the approach may be implemented without the datareductions facilities described herein.

Introduction to Rendezvous Localization Via Automatic Client IPEstimation

When the CDN rendezvous system (RVS) uses DNS (as in preferredimplementations), the RVS responds to DNS requests for recognized domainnames (CNAMEs) with a list of VIPs that are known to provide service forthe property associated with the domain name. The decision preferablytakes into account the actual availability, load, and network localityof the set of possible VIPs in order to determine a smaller list of VIPsbest suited based on the source IP address of the DNS request. However,the DNS request typically comes from an intermediate resolver, and theactual client who will use the domain name to VIP binding for subsequentHTTP requests may well be located somewhere else in the network, makingthe resolver IP-based network locality aspect of rendezvous suboptimal.This section describes a method for on-line learning of approximateclient IP locations based on the data reduction facilities of the CDNarchitecture.

The basic idea is to route a portion of DNS requests to probe VIPs basedon the source resolver IP (i.e., resolver IP address), rotate theassignments of resolver IPs (resolver IP addresses) to probe VIPs, andincrementally compute an increasingly accurate view of the set of clientIPs (client IP addresses) that appear to be using each resolver IP thathave been seen. This view is then used to compute a centroid or centerof mass of the client IP set to produce a pseudo client IP (pseudoclient IP address) that can be used as a better estimate of the actualclient IP (client IP address) than the resolver IP itself whenresponding to DNS queries.

This approach is useful only if the client IP to resolver IP associationis relatively static, that is, if it changes more slowly than thealgorithm converges. The approach is also improved by (though it doesnot depend on) tighter constraints on the use of domain names bysubscriber properties, where each property is expected to use a domainname that is unique to the property, and no two properties are allowedto use the same domain name (something which the CDN bindingarchitecture can arrange to ensure). Reliance on this constraint enablesproperty-specific localization, which can increase the networklocalization accuracy.

The following sections describe details of the basic algorithm and thendescribe some variations which are more computationally expensive butprovide additional benefits.

Notational Conventions

The following notational conventions are used in this description:

-   -   A fuzzy set {circumflex over (X)} is a pair (X, m) consisting of        an underlying set of possible members X and a membership        function m: X→[0, 1] which maps each possible member x∈X to its        degree of membership in {circumflex over (X)}, a real number in        the range [0, 1].    -   Variables beginning with c or Ĉ refer to client IP addresses and        fuzzy sets of client IP addresses, respectively.    -   Variables beginning with r or {circumflex over (R)} refer to        resolver IP addresses and fuzzy sets of resolver IP addresses,        respectively.    -   Variables beginning with p refer to probe IP addresses.    -   Variables beginning with t refer to time interval identifiers.

Basic Algorithm

The basic algorithm proceeds in discrete intervals, computing for eachtime interval a new estimate of the pseudo client IP address toassociate with each resolver IP. Each time period RVS assigns to eachunique (RIP, Name) a list of probe IP addresses (PIP). Some smallportion of requests to the RVS will be responded to with this list ofPIPs, though most will be responded to normally with a list of non-probeVIPs based on the usual load, availability, and network localityanalysis. RVS logs its PIP assignments to a log stream, with events ofthe following form:

(t,r,Name,List(p _(j)))

where each such event indicates that during time interval t, all probedrequests for Name from r were assigned to the PIPs in List(p_(j)). Itshould be appreciated that this assignment only applies to the sample ofrequests that were assigned to a probe.

During each time period, each PIP also knows the time period identifierit must use to log requests (or, alternatively, it logs events in itslog stream that indicate changes to time period identifiers, so readersof the stream can associate requests with time intervals). It learnsthis either by retrieving it via a control resource or being told via adirect management interface command. The time period identifier isrecorded in the request log stream in one of the two methods described,thereby associating a CIP c with (Name, p) for each resource request.Thus, a stream of the following events can be reduced from the logstream of each service behind a PIP:

(t,c,Name,p,N)

where each event indicates that during time interval t, the client at cmade N requests for resources in property Name from p. The serviceslistening on p could be configured to either service the requestnormally or redirect to some other VIP that will service the request(depending on whether or not redirects are allowable).

The two streams above (call them streams a and b) can then be joinedwhere t_(a)=t_(b), Name_(a)=Name_(b), and p_(b)∈List(p_(j)), resultingin events of the form:

(t,c,Name,p,N)

Moreover, since RVS knows which RIPs are assigned to each PIP p in eachtime interval, this stream may be transformed further into:

(t,c,Name,p,N,List(r _(k)))

But since the same client may request resources from any number ofdifferent properties over time, there is also a need to include streamsfrom other PIPs, ultimately resulting in the same kind of events (witheach event identifying a single CIP and PIP but multiple RIPs). It maybe desirable to reduce this further to collapse down to a single eventper CIP with a sum of all the N values and a list of PIPs, like this:

(t,c,Name,List(p _(j)),ΣN,List(r _(k)))

What happens next depends on whether the desired result is one globalassignment of pseudo client IP per resolver, or one that varies fromproperty to property, and on what factors should be considered whendeciding how to combine the information from multiple time intervals. Inall cases the goal is to compute on-line a fuzzy set of client IPs (ormultiple fuzzy sets of client IPs) for each known resolver IP, and usethe center of these sets as the client IP estimate for future DNSqueries to RVS.

Algorithm Variations

There are two dimensions of variation to the basic algorithm:

-   -   Whether to compute one client IP center per resolver (the global        approach) or one client IP per resolver per property (the        property-specific approach), and    -   Whether to treat all time intervals the same (the unweighted        interval approach) or whether to weight the time intervals        based, e.g., on the volume of requests seen during the interval        (the weighted interval approach).

These dimensions are largely orthogonal, resulting in (at least) fourpossible algorithms. The section below first describes theglobal/unweighted case and then describes how to modify the firstvariation to support weighted and property-specific cases.

Global Client Localization with No Time Interval Weighting

The simplest approach to client localization is to determine the bestRIP to assign to each CIP, and then compute one center of all CIPsassigned to each RIP. This center would then be used as the substituteCIP for all requests to RVS, regardless of what property they are for.

In this case the event stream discussed above would be reduced to theform:

(t,c,List(r _(k)))

where each event means that during time interval t, client c issued oneor more probed requests for properties that were resolved by somer∈List(r_(k)). It is not known which requests should be charged to whichresolvers, but it is known that they all came from resolvers in thislist (the description below will discuss why this is true, even in thepresence of DNS caching).

Begin by assigning a weight to each r based solely on the size of thelist it occurs in:

${w_{c,t}(r)} = \left\{ \begin{matrix}\frac{1}{{L_{t}\left( r_{k} \right)}} & {{{if}\mspace{14mu} r} \in {L_{t}\left( r_{k} \right)}} \\{0,} & {otherwise}\end{matrix} \right.$

Using this weight it is possible to arrange to incrementally compute afuzzy set {circumflex over (R)}_(c,t) based on the set of all knownResolverIPs and a membership function:

□□{circumflex over (R)} _(c,t)=(ResolverIPs,m _(c,t):ResolverIPs→[0,1])

At each time interval t the membership function m_(c,t)(r) for each r isupdated as follows. First, compute a moving average version of themember function m*_(c,t) (r), based on some constant α∈(0, 1).

m* _(c,t)(r)=α·w _(c,t)(r)+(1−α)·m _(c,t−1)(r)

and then define the actual membership function to be a thresholdedversion of the moving average using some threshold λ_(t)∈(0, 1):

${m_{c,t}(r)} = \left\{ \begin{matrix}{m_{c,t}^{*}(r)} & {{{if}\mspace{14mu} {m_{c,t}^{*}(r)}} > \lambda_{t}} \\{0,} & {otherwise}\end{matrix} \right.$

where λt might be computed, e.g., based on the minimum membership valueof the top M membership values in the set. The net effect of this is tocompute something similar to the fuzzy intersection of all the resolverIP lists seen in the stream up to time interval i (and it would beexactly that if certain elements had not been discarded using thethreshold). The thresholding allows for a fairly low bound on the sizeof the resolver IP set that needs to be maintained from step to step.

At this point there is preferably a small number of resolver IPs r withm_(c,i)(r)>0, and hopefully there is a unique r with a maximummembership value, but neither of these situations is guaranteed. Therecould be a large number of resolver IPs with a maximal membership value,though whether this is likely is not clear at the moment.

The next step is to compute the inverse relationship using themembership functions across all client IPs, identifying for eachresolver IP r a fuzzy set of client IPs, Cr, based on the relationship:

c∈Ĉ _(r)

r∈{circumflex over (R)} _(c)

which means, with a little abuse of notation, that c's membership inĈ_(r) should be the same as r's membership in {circumflex over (R)}_(c),in other words:

Ĉ _(r)=ClientIPs,m _(r))

with m_(r)(c)=m_(c)(r) for all r and c. This membership function, and byextension the fuzzy set it implies, can be computed incrementally,essentially for free based on the computation of mc. All that is neededis to maintain a table associating (r, c) pairs with a membership valuethat can be used either as m_(r)(c) or m_(c)(r).

Finally, the pseudo client IP ĉ_(i) for each resolver IP r can becomputed as the center of mass of Ĉ_(r,i) where each client IP isconsidered a position in some metric space and its membership value isits mass. In practice, the pseudo client IP ĉ_(i) (depending on how thenetwork distance metric space works) may have to be related back to anearest actual client IP, which then could act as a representative ofĈ_(r,i) from which actual network distances to candidate VIPs could becomputed.

Weighting Time Intervals

Time intervals used by the RVS may differ in their length in real timeand in the number of requests handled during the interval. The previoussection weighted each interval equally when computing membershipfunctions, but it may be useful to weight intervals differently. Whilethe length in real-time of each interval probably does not reallymatter, the number of requests handled during the interval probablydoes.

The key is to be cognizant of each resolver IP r's weight used tocompute its membership function based on the number of requests assignedto each event. So in this case the considered event stream is reduced tothe form:

(t,c,List(r _(k)),N)

A weight function is needed that increases and decreases with N but isalways in the range [0, 1]. For this it is possible to define a movingaverage Ñ of N values:

Ñ _(i) =α—N _(i)+(1−α)·Ñ _(i−1)

and then use this to normalize the latest value of N, producing weightδi:

$\delta_{i} = \frac{N_{i}}{N_{i} + {\overset{\sim}{N}}_{i}}$

Now change the weight function used in the previous section to include amultiplier δ_(i):

${w_{c,i}(r)} = \left\{ \begin{matrix}\frac{\delta_{i}}{L_{i}} & {{{if}\mspace{14mu} r} \in L_{i}} \\{0,} & {otherwise}\end{matrix} \right.$

Property-Specific Localization

The global approach may be extended to compute a property specificclient estimate for each resolver.

A property-specific localization requires separate maintenance of stateper property, but the computation for each property only needs to take asubset of the event stream into consideration. It should be appreciatedthat in some cases it may be worthwhile to do a property specificcomputation, and then compute a global result based on the propertyspecific results.

The benefit of the property specific approach is that the center of massof client requests may vary from property to property, and therefore aproperty specific computation will produce a more accurate result.

Other Considerations

Time Intervals and DNS Caching

For the above approach to work there needs to be some assurance thatclient requests to probe IPs are using information they received fromRVS through particular resolver IPs. With DNS caching, ensuring thisrequires that there is control of the pace of change to resolver IPmappings to probe IPs and sequence their changes in a way that takessome reasonable upper bound on DNS time-to-live values.

The state of RVS and a given probe IP with respect to the assignedresolver IPs and whether or not requests to the probe will be associatedwith the resolver IPs must be sequenced through the following cycle(representing one time interval for the PIP):

-   -   In active probe mode, during which all requests to the probe IP        will be associated with assigned resolver IPs, and RVS will        actively respond to queries with the probe IP,    -   In passive probe mode, during which RVS will no longer respond        to queries with the probe IP, but the probe will still respond        to requests and they will still be associated with the assigned        resolver IPs,    -   In normal mode, where RVS will not send probe requests there and        there will be no association between requests and resolver IPs,    -   Back to active probe mode, but assigned to a possibly different        set of resolver IPs, etc.

RVS must manage available probe IPs and ensure that the real-time lengthof a probe IP's time in passive probe mode must be greater than or equalto some multiple of the DNS TTL threshold. Straggler requests based onstale resolver IP assignments may still be received and would be countedincorrectly, but the volume of these requests can be driven arbitrarilylow with a sufficiently large TTL threshold, and the fuzzy setcomputation is robust to such perturbations.

Computing Resolver IP Assignments

The previous section described constraints on how resolver IPassignments must be scheduled, but did not say anything about whatresolver IP assignments to use at each interval. For rapid convergenceit is possible to use a heuristic approach based on separating resolverIPs that need to be distinguished. Whenever there is a value of{circumflex over (R)}_(c) that has multiple maximal resolver IPs in it,these should ideally be split apart in future assignments. Requests fromclient c will eventually fall into one or the other of the newassignments, allowing an inference to be drawn that c is associated withthe resolver associated with the assignment that it followed.

This cannot be done client by client, but instead there needs to bedetermined a global (or property-specific) affinity measure betweenresolver IPs, and this affinity is preferably used to determine whichresolvers to split apart in future assignments. The higher the affinitybetween two resolver IPs, the lower the likelihood of being able todistinguish their clients, and the higher the need to assign themdifferently in future intervals.

One measure for affinity could be the statistical correlation betweenresolver IP membership functions, say the sample Pearson correlationcoefficient. In other words, imagine a table with client IP as a key (xvalue) and a column for each resolver IP, with the value of eachresolver IP column equal to its membership in the client's fuzzyresolver set (y_(r)=mc (r)). Compute the correlation coefficient betweenthe membership values for pairs of resolvers across all client IPs,possibly throwing out data points where both are 0.

Time Interval Synchronization

Allocation of Probes

The number of probes that can be used will depend on how different aprobe behaves than a regular service, and how expensive it is to collectprobe information. The more probes are like regular services, and thesimpler the collection, the more probes can be used and hence the fasterthe convergence to an accurate view of client localization. It may ormay not be necessary to have only a small number of probes, it could bethat all services are capable of being probes, and probe data collectioncould be a simple addition to log stream processing.

Accuracy Estimation and Feedback

The choice of which resolver IPs to reassign in subsequent intervalscould also be driven by an estimate of the accuracy of the resolver'sclient pool. Computing the fuzzy intersection of the client pools mightbe one way, but it is not clear if this would add any more informationthan the resolver IP correlation discussed above.

Another way would be to directly test resolver hypotheses by providing aseparate pool of probe-like IPs, called test IPs (TIPS), but with theconstraint that each is assigned to exactly one resolver IP at a time.Doing this for every resolver would be too expensive, but it could beused selectively.

Beacon Services

With reference to FIGS. 32-A to 32-C, when an application or service3200 associated with a client 3202 makes a request to/of a CD service3204, the CD service 3204 responds to the requesting client in a mannerappropriate for the kind of service and request. The CD service 3204 mayuse the request-response processing described above. As part of itsoperation, including request-response processing, the CD service 3204may generate one or more event streams that may potentially provideinformation to a reducer services network or a collector servicesnetwork. However, in addition to, or instead of, communicating eventinformation to a reducer services network or a collector servicesnetwork, a CD service may also encode or embed information about therequest/response with client 3202 and include that encoded/embedinformation in a so-called beacon request 3206 (e.g., an HTTP request)to a beacon service 3208. As used herein a beacon request is the termused to describe a request containing or encoding information and madeto a beacon service.

A beacon service 3208 is a CD service that, inter alia, obtains beaconrequests from other CD services, and decodes or otherwise unpacks theinformation encoded or embedded in the beacon requests. A beacon servicemay also provide information that it derives from beacon requests to areducer services network and/or a collector services network.

The CD service 3204 making the beacon request may be in a different CDNor sub-CDN from the beacon service 3208, as shown by the boundary lineX-X′ in FIG. 32-A. For example, the beacon service may be in aparticular CDN with the CD service being in a delegated CDN of thatparticular CDN.

With reference to the flow chart in FIG. 32-B, the CD service 3204obtains and processes a request in the manner appropriate for the typeof CD service (at S3210). The CD service 3204 then composes a request(preferably an HTTP request) and makes the HTTP request to a beaconservice 3208. It should be appreciated that an HTTP request includes anHTTPS request.

The CD service 3204 may use other CD services (e.g., rendezvousservices) to determine which beacon service 3208 to use. In some casesthe beacon service 3208 may be part of a beacon service network.

With reference to the flow chart in FIG. 32-C, upon receipt of a beaconrequest (at S3214), a beacon service decodes or unpacks informationassociated with that request (at S3216). The information obtained orderived from the request may be stored locally at the beacon serviceand/or sent as event information to collectors (possibly via reducers)(at S3218).

The CD service 3204 may be any kind of CD service, including aninfrastructure service, a delivery service (such as a rendezvousservice, caching service, streaming service, object service, or computeservice), or an ancillary service (such as fill service, origin service,or storage service).

The client 3202 may be part of the CDN or an external client. When partof the CDN, the client may be a CD service.

In the case of certain delivery services (e.g., caching and streamingservices), the information included in the beacon request may includesome or all of:

-   -   a requested URL    -   a request method    -   a request protocol version    -   a user-agent: header value    -   a referrer: header value    -   a cookie: header value    -   a start time of request    -   a completion time of request (either of which could be replaced        by duration)    -   a time-to-first-byte    -   a number of bytes transferred    -   a size of resource (or indicator of whether transfer was        completed)    -   a size of request/response headers    -   an indicator of whether the resource was fresh in cache

Those of ordinary skill in the art will realize and appreciate, uponreading this description, that these are merely examples of the kind ofinformation that may be encoded or included in a beacon request, anddifferent and/or other information may also be included in a beaconrequest.

As noted, a beacon request is preferably an HTTP request, andinformation to be provided with/encoded in the request may be in the URLassociated with the request and/or the request header. Most systemstoday allow at least 4K byte for an HTTP header, with many systemsallowing more. Any form of encoding may be used to provide theinformation, including key-value pairs for predefined keys. Upon receiptof a beacon request a beacon service decodes the encoded informationusing a corresponding technique. Information contained in a beaconrequest may be encrypted by the CD service, in which case the beaconservice may need to decrypt the information as part of its decodingprocess. Although described here as an HTTP GET request, it should beappreciated that a beacon request may also be conveyed in the body of anHTTP POST request.

In some cases a beacon service may put the information from a beaconrequest into an event and provide the information “as is”, without anyprocessing, directly to a collector system (possibly via a reducersystem).

In some embodiments hereof information about multiple request/responsetransactions may be contained inside a given beacon request. In somecases the system may use a long-lived connection that permits a longstream of transaction reports to be sent upstream to one or more beaconservices.

Summary of Beacon Services

This section includes a non-limiting summary of some aspects of beaconservices.

In some aspects, embodiments hereof may be or comprise acomputer-implemented method, operable with a content delivery frameworkhaving multiple CD services including at least one beacon service, themethod may include, at particular CD service in the content deliveryframework: obtaining at least one first request; responding to the atleast one first request; and making a second request to a beacon CDservice, where the second request includes information about the atleast one first request. The beacon CD service may be in a CDN and theparticular CD service may be in a delegated CDN of the CDN. In somecases the information about the at least one first request may includeinformation about the particular CD service's responding to the at leastone first request. In some cases the particular CD service may make thesecond request after completion of the responding to the at least onefirst request.

The particular CD service may be a delivery service and the at least onefirst request may comprise a first HTTP request. The second request maybe or comprise a second HTTP request. In some cases information aboutthe at least one first request that is included in the second requestmay be contained, at least in part, in an HTTP header associated withthe second request. The method may also include, at the particularservice in the content delivery framework: obtaining a third request;and responding to the third request, wherein the second request to thebeacon CD service also includes information about the third request.

In some other aspects hereof, embodiments hereof may be or comprise acomputer-implemented method, operable with a content delivery frameworkhaving multiple CD services including at least one beacon service, wherethe method includes, at particular beacon service in the contentdelivery framework: obtaining a beacon request from a particular CDservice, the request including first information about at least onefirst request that was made to the particular CD service; determininginformation about the at least one first request from the beaconrequest; and providing the information determined from the beaconrequest to at least one collector service. The collector service may bepart of the content delivery framework. The providing may be done via areducer service. The particular CD service may be a delivery service andthe at least one first request may have comprised a first HTTP request.

At least some of the information may be provided as an event stream fromthe beacon service.

In some other aspects hereof, embodiments hereof may be or comprise adevice operable in a content delivery framework, where the contentdelivery framework has multiple CD services, and the device has:hardware including memory and at least one processor, and a beaconservice running on the hardware, where the beacon service may beconfigured to: obtain a beacon request from a particular CD service, thebeacon request including first information about at least one firstrequest that was made to the particular CD service; determineinformation about the at least one first request from the beaconrequest; and provide the information determined from the beacon requestto at least one collector service. The particular CD service may be adelivery service and the at least one first request may have comprised afirst HTTP request. The beacon request may also include secondinformation about at least one other request that was made to theparticular CD service, and the beacon service may be configured to:determine the second information from the beacon request and to providethe second information to at least one collector service.

In some other aspects hereof, embodiments hereof may be or comprise adevice operable in a content delivery framework, the content deliveryframework having multiple CD services, the device having: hardwareincluding memory and at least one processor, and a particular CD servicerunning on the hardware, where the beacon service may be configured to:obtain at least one first request; respond to the at least one first therequest; and make a second request to a beacon CD service, the secondrequest including information about the at least one first request. Theparticular CD service may be a delivery service and the at least onefirst request may have comprised a first HTTP request made to thedelivery service. In some other aspects hereof, embodiments hereof maybe or comprise a system comprising the device described herein.

In some other aspects hereof, embodiments hereof may be or comprise acomputer program product having computer readable instructions stored oncomputer readable media, the computer readable instructions includinginstructions for implementing a computer-implemented method, the methodoperable on a device comprising hardware including memory and at leastone processor and running a service on the hardware, the method operablein a content delivery framework, the content delivery framework havingmultiple CD services, the method comprising: at particular CD service inthe content delivery framework: obtaining at least one first request;responding to the at least one first request; and making a secondrequest to a beacon CD service, the second request including informationabout the at least one first request. The computer readable media may benon-transitory. The particular CD service may be a delivery service andthe at least one first request may have comprised at least a first HTTPrequest made to the delivery service.

The information about the at least one first request may include atleast some of:

-   -   (a) a requested URL associated with the at least one first        request;    -   (b) a request method associated with the at least one first        request;    -   (c) a request protocol version associated with the at least one        first request;    -   (d) a user-agent: header value associated with the at least one        first request;    -   (e) a referrer: header value associated with the at least one        first request;    -   (f) a cookie: header value associated with the at least one        first request;    -   (g) a start time associated with the at least one first request    -   (h) a completion time associated with the at least one first        request;    -   (i) a time-to-first-byte associated with the at least one first        request;    -   (j) a number of bytes transferred associated with the at least        one first request;    -   (k) a size of resource associated with the at least one first        request;    -   (l) an indicator of whether a transfer associated with the at        least one first request was completed    -   (m) a size of request/response headers associated with the at        least one first request; and    -   (n) an indicator of whether a resource associated with the at        least one first request was fresh in cache.

The particular CD service may be selected from the CD servicesincluding: delivery services, rendezvous services, caching services,streaming services, object services, compute services, fill services,origin services, and storage services.

CONCLUSION

While various embodiments have been described herein, other manners arecontemplated. For example, a service may be used to re-write URLsincluded in electronic resources and/or to redirect end user requests.Such a service may be located at subscribers' origin servers orelsewhere and/or can be operated off-line or on-line with respect to enduser requests. An example of a reflector embodying aspects of suchservices can be found in U.S. Pat. No. 6,185,598 and U.S. ApplicationPublication No. 2011-0219120, each of which are hereby fullyincorporated by reference for all purposes.

As used herein, the term “reject” refers to the denial of a requestbased on some level of consideration and/or analysis and/or evaluation.In one embodiment, a rejection includes a reply or response indicating,directly or indirectly, or otherwise suggesting that a request isdenied. As examples, such a rejection may include a reply containing anerror indication or may be signaled response, e.g., at the transportlayer, e.g., by closing a connection. Some rejections, however, may besilent or otherwise provide no feedback to the requestor. For example, arequest for invalid content may be rejected by a non-response.

As used herein, including in the claims, the phrase “at least some”means “one or more,” and includes the case of only one. Thus, e.g., thephrase “at least some services” means “one or more services”, andincludes the case of one service.

As used herein, including in the claims, the phrase “based on” means“based in part on” or “based, at least in part, on,” and is notexclusive. Thus, e.g., the phrase “based on factor X” means “based inpart on factor X” or “based, at least in part, on factor X.” Unlessspecifically stated by use of the word “only”, the phrase “based on X”does not mean “based only on X.”

As used herein, including in the claims, the phrase “using” means “usingat least,” and is not exclusive. Thus, e.g., the phrase “using X” means“using at least X.” Unless specifically stated by use of the word“only”, the phrase “using X” does not mean “using only X.”

In general, as used herein, including in the claims, unless the word“only” is specifically used in a phrase, it should not be read into thatphrase.

As used herein, including in the claims, the phrase “distinct” means “atleast partially distinct.” Unless specifically stated, distinct does notmean fully distinct. Thus, e.g., the phrase, “X is distinct from Y”means that “X is at least partially distinct from Y,” and does not meanthat “X is fully distinct from Y.” Thus, as used herein, including inthe claims, the phrase “X is distinct from Y” means that X differs fromY in at least some way.

As used herein, including in the claims, a list may include only oneitem, and, unless otherwise stated, a list of multiple items need not beordered in any particular manner. A list may include duplicate items.For example, as used herein, the phrase “a list of CDN services” mayinclude one or more CDN services.

It should be appreciated that the words “first” and “second” in thedescription and claims are used to distinguish or identify, and not toshow a serial or numerical limitation. Similarly, the use of letter ornumerical labels (such as “(a)”, “(b)”, and the like) are used to helpdistinguish and/or identify, and not to show any serial or numericallimitation or ordering.

No ordering is implied by any of the labeled boxes in any of the flowdiagrams unless specifically shown and stated. When disconnected boxesare shown in a diagram, e.g., boxes labeled 2454, 2456, 2458 in FIG.24-I, the activities associated with those boxes may be performed in anyorder, including fully or partially in parallel.

While the invention has been described in connection with what ispresently considered to be the most practical and preferred embodiments,it is to be understood that the invention is not to be limited to thedisclosed embodiment, but on the contrary, is intended to cover variousmodifications and equivalent arrangements included within the spirit andscope of the appended claims.

We claim:
 1. A framework supporting content delivery and comprising aplurality of devices, each device comprising hardware including memoryand at least one processor, each device configured to run at least onecontent delivery (CD) service of a plurality of CD services, wherein (A)said plurality of CD services comprise: collector services, controlservices, and storage services; and wherein (B) at least some of said CDservices produce, as event output, one or more event streams relating totheir respective operation; and (C) at least some of said event outputis provided to at least some of said collector services; and wherein atleast some of said plurality of devices run storage services, andwherein said storage services running on said at least some of saidplurality of devices comprise at least one storage services network,wherein at least one said storage service is configured to providepersistent storage in the CDN.
 2. The framework of claim 1 wherein atleast one said storage service is configured to provide persistentstorage that is locally addressable.
 3. The framework of claim 1 whereinat least one said storage service is configured to provide persistentstorage that is globally addressable.
 4. The framework of claim 1wherein at least one said storage service has rights associatedtherewith for controlling access.
 5. The framework of claim 1 whereinsaid at least one storage network is implemented with web protocols. 6.The framework of claim 5 wherein the web protocols comprise one or moreof: HTTP, HTTPS, and FTP.
 7. The framework of claim 1 wherein at leastone said storage service is used for internal CDN storage.
 8. Theframework of claim 1 wherein at least one said storage service supportsone or more of: read, write, update, and delete operations.
 9. Theframework of claim 1, wherein each storage service is configured to: (i)generate information relating to operation of said storage service; and(ii) to provide at least some of said information as event informationto at least one other CD service.
 10. The framework of claim 9 whereinsaid plurality of CD services also comprise: reducer services, andwherein the at least one other CD service to which the particularstorage service is to provide event information comprise at least one CDservice selected from: (a) one or more collector services; and (b) oneor more reducer services.
 11. The framework of claim 10 wherein for eachparticular storage service of said storage services, at least some eventoutput to be generated by the particular storage service is dynamicallycontrolled and configured based on at least one of: (1) controlinformation received at said particular storage service from saidcontrol services, and (2) state information received at said particularstorage service from said collector services.
 12. The framework of claim10 wherein for each particular storage service of said storage services,at least one other CD service to which a particular storage service isto provide event output is dynamically controlled and configured basedon at least one of: (1) control information received at said particularstorage service from said control services, and (2) state informationreceived at said particular storage service from said collectorservices.
 13. The framework of claim 9 wherein the at least one other CDservice to which the particular storage service is to provide eventinformation includes one or more collector services, and wherein, foreach particular collector service of the one or more collector services,at least some storage services to which the particular collector serviceis to provide state output is dynamically controlled and configuredbased on at least one of: (1) control information received at saidparticular collector service from said control services; and (2) stateinformation received at said particular collector service from saidcollector services.
 14. The framework of claim 9 wherein the at leastone other CD service to which the particular storage service is toprovide event information includes one or more collector services, andwherein, for each particular collector service of the collectorservices, at least some storage services from which the particularcollector service is to accept input is dynamically controlled andconfigured based on at least one of: (1) control information received atsaid particular collector service from said control services; and (2)state information received at said particular collector service fromsaid collector services.
 15. The framework of claim 9 wherein the atleast one other CD service to which the particular storage service is toprovide event information includes one or more reducer services, andwherein, for each particular reducer service of the one or more reducerservices, at least some storage services from which the particularreducer service is to accept input is dynamically controlled andconfigured based on at least one of: (1) control information received atsaid particular reducer service from said control services; and (2)state information received at said particular reducer service from saidcollector services.
 16. The framework of claim 1 wherein each storageservice is further configured to obtain control information from saidcontrol services.
 17. The framework of claim 16 wherein each storageservice is further configured to modify its operation or configurationbased on control information from said control services.
 18. Theframework of claim 1 wherein each storage service is further configuredto obtain state information from said collector services.
 19. Theframework of claim 18 wherein each storage service is further configuredto modify its operation or configuration based on state information fromsaid collector services.
 20. The framework of claim 1 wherein at leastsome of said collector services: provide at least some of said stateinformation to CD services.
 21. A content delivery network (CDN)comprising a plurality of devices, each device comprising hardwareincluding memory and at least one processor, each device configured torun at least one content delivery (CD) service of a plurality of CDservices, wherein said CD services are selected from the servicescomprising: collector services, storage service, and control services;and wherein (A) at least some of said CD services produce event outputrelating to their respective operation; and wherein (B) at least some ofsaid event output from at least some of said CD services is provided toat least some of said collector services; and wherein at least some ofsaid plurality of devices run storage services, and wherein said storageservices running on said at least some of said plurality of devicescomprise at least one storage services network, wherein at least onesaid storage service is configured to provide persistent storage in theCDN that is that is one or more of: (i) locally addressable, and (ii)globally addressable.
 22. The CDN of claim 21 wherein, for eachparticular storage service of said storage services, at least some eventoutput to be produced by said particular storage service is dynamicallycontrolled and configured based on at least one of: (i) controlinformation received by the particular storage service from said controlservices; and (ii) state information received by the particular storageservice from said collector services.
 23. The CDN of claim 21 wherein atleast some of said storage services provide event output to said one ormore collector services in said collector services network, and wherein,for each particular storage service of said storage services, at leastsome collector services to which the particular storage service is toprovide event output is dynamically controlled and configured based onone or more of (i) control information received by the particularstorage service from said control services, and (ii) state informationreceived by the particular CD service from said collector services. 24.The CDN of claim 21 wherein said plurality of CD services also comprise:reducer services, at least some of said devices running reducer servicescomprise a reducer services network, and wherein at least some of saidstorage services provide event output to said one or more reducerservices in said reducer services network, and wherein, for eachparticular storage service of said storage services, at least somereducer services to which the particular storage service is to provideevent output is dynamically controlled and configured based on one ormore of (i) control information received by the particular storageservice from said control services, and (ii) state information receivedby the particular CD service from said collector services.
 25. Thecontent delivery network of claim 21 wherein at least some of saidcollector services: provide at least some of said state information toCD services to control operation or configuration of said CD services.26. A system comprising a plurality of devices, each device comprisinghardware including memory and at least one processor, each deviceconfigured to run at least one content delivery (CD) service of aplurality of CD services, wherein said CD services are selected from theservices comprising: storage services, collector services, controlservices, and delivery services; and wherein (A) at least some of saiddevices run collector services, and at least some of said devices runcontrol services, and wherein (B) said at least some of said devicesrunning collector services comprise a collector services network; and(C) at least some of said CD services produce event output relating totheir respective operation; and wherein (D) said collector servicesnetwork provides state information to said control services, said stateinformation being based on said input from said collector servicesnetwork; and wherein (E) at least some of said control services providecontrol information to said CD services, at least some of said controlinformation being based on state information from the collector servicesnetwork; and wherein wherein at least some of said plurality of devicesrun storage services, and wherein said storage services running on saidat least some of said plurality of devices comprise at least one storageservices network, wherein at least one said storage service isconfigured to provide persistent storage in the CDN that is that is oneor more of: (i) locally addressable, and (ii) globally addressable. 27.The system of claim 26 wherein, at least some of event output from aparticular storage service is provided to one or more locations in saidcollector services network; and wherein said one or more locations insaid collector services network to which event output from saidparticular storage service is to be provided is dynamically controlledand configured, based on one or more of: (i) control informationreceived by the particular storage service from said control services,and (ii) state information received by the particular storage servicefrom said collector services network.
 28. The system of claim 26 whereineach collector in said collector service network accepts event outputfrom one or more storage services, and wherein the one or more storageservices from which a particular collector accepts event output isdynamically controlled and configured, based on one or more of: (i)control information received by the particular collector service fromsaid control services, and (ii) state information received by theparticular collector service from said collector services network. 29.The system of claim 26 wherein at least some of said storage servicesprovide event output to said one or more reducer services in saidreducer services network, and wherein, for each particular storageservice of said storage services, at least some reducer services towhich the particular storage service is to provide event output isdynamically controlled and configured based on one or more of (i)control information received by the particular storage service from saidcontrol services, and (ii) state information received by the particularCD service from said collector services.
 30. The system of claim 26wherein said collector services network also provides state informationto other CD services of said plurality of CD services.